0
0
DBMS Theoryknowledge~10 mins

Deadlock handling in databases in DBMS Theory - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to detect a deadlock in a database system.

DBMS Theory
SELECT * FROM [1] WHERE waiting = TRUE;
Drag options to blanks, or click blank then click option'
Adeadlock_detection
Bsessions
Clocks
Dtransactions
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'transactions' instead of the deadlock detection view.
Confusing locks with deadlock detection.
2fill in blank
medium

Complete the code to resolve a deadlock by aborting a transaction.

DBMS Theory
KILL [1];
Drag options to blanks, or click blank then click option'
Atransaction_id
Block_id
Csession_id
Dprocess_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using transaction_id which may not be directly killable.
Using lock_id which is not a valid target for KILL.
3fill in blank
hard

Fix the error in the SQL statement to detect deadlocks.

DBMS Theory
SELECT * FROM deadlock_detection WHERE [1] = TRUE;
Drag options to blanks, or click blank then click option'
Ablocked
Blocked
Cactive
Dwaiting
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'locked' or 'blocked' which are not standard columns for deadlock detection.
Using 'active' which indicates transaction status but not waiting.
4fill in blank
hard

Fill both blanks to create a query that lists transactions involved in deadlocks and their wait times.

DBMS Theory
SELECT transaction_id, [1] FROM deadlock_detection WHERE [2] = TRUE;
Drag options to blanks, or click blank then click option'
Await_time
Blocked_time
Cwaiting
Dstart_time
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'locked_time' with 'wait_time'.
Using 'start_time' which is not related to waiting status.
5fill in blank
hard

Fill all three blanks to write a query that identifies deadlocked transactions, their blocking transaction, and the resource involved.

DBMS Theory
SELECT [1], [2], [3] FROM deadlock_detection WHERE waiting = TRUE;
Drag options to blanks, or click blank then click option'
Atransaction_id
Bblocking_transaction_id
Cresource_id
Dsession_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'session_id' instead of 'blocking_transaction_id'.
Mixing up resource and transaction identifiers.