Question 343 of 1,663
DBS-C01 Workload-Specific Database Design Practice Question
Exhibit
Refer to the exhibit. ``` 2024-03-15 10:23:45 UTC | aurora-db-instance-1: Aurora MySQL 2024-03-15 10:23:45 UTC | 10.0.1.5:12345 [3] [thread 1] [transaction 1234] 2024-03-15 10:23:45 UTC | ERROR: Deadlock found when trying to get lock; try restarting transaction 2024-03-15 10:23:45 UTC | at line 1: UPDATE orders SET status='shipped' WHERE order_id=1001; 2024-03-15 10:23:45 UTC | at line 2: UPDATE inventory SET quantity=quantity-1 WHERE product_id=500; ```
A database specialist is analyzing an Aurora MySQL error log and finds the above deadlock error. The application performs an update on the orders table and then updates the inventory table within the same transaction. The deadlock occurs when two concurrent transactions try to update orders and inventory in different orders. Which design change should the database specialist recommend to reduce deadlocks?
⚠ Common exam trap
Watch out — candidates often think combining tables or using SELECT ... FOR UPDATE will prevent deadlocks, but the root cause is inconsistent lock ordering, not the number of tables or the use of explicit locking.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Ensure all transactions update tables in the same order (e.g., always update inventory first, then orders)
Deadlocks in Aurora MySQL often occur when concurrent transactions acquire row-level locks on tables in different orders. By enforcing a consistent lock order (e.g., always updating inventory first, then orders), the database can avoid circular wait conditions, which are a necessary condition for deadlocks. This is a standard best practice for reducing deadlocks in InnoDB, which uses row-level locking and two-phase locking.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Combine the orders and inventory tables into a single table to avoid multiple table locks
Why it's wrong here
Combining tables denormalizes the schema and is not a standard solution for deadlocks.
- ✓
Ensure all transactions update tables in the same order (e.g., always update inventory first, then orders)
Why this is correct
Consistent lock ordering prevents circular wait conditions, reducing deadlocks.
- ✗
Use SELECT ... FOR UPDATE on both tables before updating
Why it's wrong here
This still requires a consistent lock order; if two transactions lock in different order, deadlock can still occur.
- ✗
Change the transaction isolation level to READ UNCOMMITTED
Why it's wrong here
READ UNCOMMITTED may reduce locking but can lead to dirty reads and other concurrency issues.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
This DBS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DBS-C01 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.