Transaction · Databases
38 questions · asked in 20 of 27 years (2000–2026)
MCQ 32 · MSQ 5 · NAT 11-mark 19 · 2-mark 19
2000Questions per year2026
Questions 11–15 of 38
Let S be the following schedule of operations of three transactions in a relational database system:
Consider the statements P and Q below:
P: S is conflict-serializable.
Q: If commits before finishes, then S is recoverable.
Which one of the following choices is correct?
Consider the statements P and Q below:
P: S is conflict-serializable.
Q: If commits before finishes, then S is recoverable.
Which one of the following choices is correct?
Answer: (B)
Conflicts:
- comes before : T1 T2
- comes before : T1 T3
- comes before : T2 T3
There is no cycle so S is conflict serializable (T1, T2, T3). P is true.
T3 reads X written by T1. If T3 commits before T1 and T1 aborts later, T3 cannot be undone so S is not recoverable. Q is false.
Answer: P is true and Q is false
- comes before : T1 T2
- comes before : T1 T3
- comes before : T2 T3
There is no cycle so S is conflict serializable (T1, T2, T3). P is true.
T3 reads X written by T1. If T3 commits before T1 and T1 aborts later, T3 cannot be undone so S is not recoverable. Q is false.
Answer: P is true and Q is false
Consider a schedule of transactions T1 and T2:
Here, RX stands for "Read(X)" and WX stands for "Write(X)". Which one of the following schedules is conflict equivalent to the above schedule?
Here, RX stands for "Read(X)" and WX stands for "Write(X)". Which one of the following schedules is conflict equivalent to the above schedule?
Answer: (A)
Two operations conflict when they are on the same item, in different transactions, and at least one is a write. A schedule is conflict equivalent to the given one only if every conflicting pair keeps its order. These pairs conflict in the given schedule:
- Item B: the RB and WB of come before the WB of .
- Item C: the RC of comes before the WC of .
- Item D: the RD of comes before the WD of .
Item A is used only by , so it gives no conflict.
Now look at schedule (A). It runs : RB WB RD, then : RA RC WD WB, then : WC. All three orders are kept.
Each of the other schedules reverses a pair:
- (B) runs all of first, so the WB of comes before the RB and WB of (item B reversed). The WD of also comes before the RD of .
- (C) has the WD of before the RD of (item D reversed).
- (D) has the WC of before the RC of (item C reversed).
Answer: (A)
- Item B: the RB and WB of come before the WB of .
- Item C: the RC of comes before the WC of .
- Item D: the RD of comes before the WD of .
Item A is used only by , so it gives no conflict.
Now look at schedule (A). It runs : RB WB RD, then : RA RC WD WB, then : WC. All three orders are kept.
Each of the other schedules reverses a pair:
- (B) runs all of first, so the WB of comes before the RB and WB of (item B reversed). The WD of also comes before the RD of .
- (C) has the WD of before the RD of (item D reversed).
- (D) has the WC of before the RC of (item C reversed).
Answer: (A)
Consider the following two statements about database transaction schedules:
I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas' Write Rule can generate view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas' Write Rule can generate view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
Answer: (C)
Let us check both statements one by one.
- Strict 2PL keeps all exclusive locks until the transaction commits. So its schedules are conflict serializable, and no transaction reads data that is not yet committed the schedule is recoverable Statement I is TRUE.
- Thomas' write rule skips obsolete writes. Because of this, some schedules are view serializable but not conflict serializable (blind writes) Statement II is TRUE.
Answer: Both I and II
- Strict 2PL keeps all exclusive locks until the transaction commits. So its schedules are conflict serializable, and no transaction reads data that is not yet committed the schedule is recoverable Statement I is TRUE.
- Thomas' write rule skips obsolete writes. Because of this, some schedules are view serializable but not conflict serializable (blind writes) Statement II is TRUE.
Answer: Both I and II
In a database system, unique time stamps are assigned to each transaction using Lamport's logical clock . Let TS() and TS() be the timestamps of transactions and respectively. Besides, holds a lock on the resource R, and has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.
Assume any transactions that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
if TS(T2) < TS(T1) then
T1 is killed
else T2 waits. Assume any transactions that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
Answer: (A)
When the requester T2 is older (it has the smaller timestamp), the younger holder T1 is killed. Otherwise, the younger requester waits. So a transaction only waits for an older transaction. This means no cycle of waits can form the system is deadlock-free.
A killed transaction restarts with its old timestamp. Compared with new transactions, it keeps getting older, and in the end it becomes the oldest one. The oldest transaction is never killed the system is starvation-free.
Answer: both deadlock-free and starvation-free
A killed transaction restarts with its old timestamp. Compared with new transactions, it keeps getting older, and in the end it becomes the oldest one. The oldest transaction is never killed the system is starvation-free.
Answer: both deadlock-free and starvation-free
Two transactions are given as:
where denotes a read operation by transaction on a variable V and denotes a write operations by transaction on a variable V. The total number of conflict serializable schedules that can be formed by is _____________.
where denotes a read operation by transaction on a variable V and denotes a write operations by transaction on a variable V. The total number of conflict serializable schedules that can be formed by is _____________.
Answer: 54
Let with and . Let with and . The only shared item is , and two reads do not conflict, so the conflicting pairs are , and . A schedule is conflict serializable only if all these pairs point the same way: either all of 's operations come before 's, or all of 's come before 's.
- before on : must come before . This is only the serial schedule , so there is 1 way.
- before on : must come before . There are interleavings in all. Count those with before : if no is before , then come first and can sit in any of 5 places among , giving 5. If only is before , then can be ordered in 3 ways and can sit in 4 places among , giving 12. So have before , and are valid.
Total =
Answer: 54
- before on : must come before . This is only the serial schedule , so there is 1 way.
- before on : must come before . There are interleavings in all. Count those with before : if no is before , then come first and can sit in any of 5 places among , giving 5. If only is before , then can be ordered in 3 ways and can sit in 4 places among , giving 12. So have before , and are valid.
Total =
Answer: 54
Keep practising