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 1–5 of 38
Consider concurrent execution of two transactions and in a DBMS, both of which access a data object . For these two transactions to not conflict on , which one of the following statements must be true?
Answer: (A)
Two operations from different transactions on the same data object "conflict" (in the standard DBMS concurrency-control sense) exactly when at least one of them is a write. So the read-write, write-read and write-write pairs all conflict, because the order of execution can change the result.
The only case with no conflict is when both transactions only read . Reads do not interfere with each other in any order, since neither one changes the value of .
Answer: Both T1 and T2 only read A.
The only case with no conflict is when both transactions only read . Reads do not interfere with each other in any order, since neither one changes the value of .
Answer: Both T1 and T2 only read A.
A schedule of three database transactions , , and is shown. and denote read and write of data item by transaction , . The transaction aborts at the end. Which other transaction(s) will be required to be rolled back?
Answer: (C)
The schedule is: .
Before it aborts, writes . Any transaction that reads this value of afterward has read "dirty" data. That transaction must be rolled back too (cascading rollback).
- does after . So it reads the uncommitted write of . must roll back.
- also does later. No other transaction wrote in between, because only read it. So also reads the dirty value of . must roll back too.
Answer: Both T2 and T3
Before it aborts, writes . Any transaction that reads this value of afterward has read "dirty" data. That transaction must be rolled back too (cascading rollback).
- does after . So it reads the uncommitted write of . must roll back.
- also does later. No other transaction wrote in between, because only read it. So also reads the dirty value of . must roll back too.
Answer: Both T2 and T3
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account attempted simultaneous transfers of Rs. 10000 each from account to account . Both transactions read the same value, Rs. 11000, as the initial balance in and were allowed to go through. was credited Rs. 10000 twice. was debited only once and ended up with a balance of Rs. 1000.
Which of the following properties is/are certain to have been violated by the system?
Which of the following properties is/are certain to have been violated by the system?
One or more options are correct.
Answer: (B), (C)
This is the standard lost-update problem. Two transactions read the same old value, and one overwrites the effect of the other.
- Consistency is violated. A transfer must keep the total money the same. Here was debited Rs. 10000 once, but was credited Rs. 20000, so Rs. 10000 was created from nothing. A serial run would have rejected the second transfer, because had only Rs. 1000 left after the first.
- Isolation is violated. Both transactions read the balance of before either one had updated it, so their effects clashed. In a serial or serializable execution the second one would have seen the Rs. 1000 balance.
- Atomicity is not necessarily violated. Each transaction ran fully to the end, and none was executed in part.
- Durability is not related here. Nothing suggests that committed data was lost because of a crash.
Answer: (B), (C)
- Consistency is violated. A transfer must keep the total money the same. Here was debited Rs. 10000 once, but was credited Rs. 20000, so Rs. 10000 was created from nothing. A serial run would have rejected the second transfer, because had only Rs. 1000 left after the first.
- Isolation is violated. Both transactions read the balance of before either one had updated it, so their effects clashed. In a serial or serializable execution the second one would have seen the Rs. 1000 balance.
- Atomicity is not necessarily violated. Each transaction ran fully to the end, and none was executed in part.
- Durability is not related here. Nothing suggests that committed data was lost because of a crash.
Answer: (B), (C)
Consider the database transactions and , and data items and . Which of the schedule(s) is/are conflict serializable?
One or more options are correct.
Answer: (B)
Draw the conflict (precedence) graph for each schedule. Add an edge when an operation of on a data item comes before a conflicting operation of on the same item. Two operations conflict when they touch the same item and at least one is a write. The schedule is conflict serializable only if the graph has no cycle.
(A) : the first comes before , so . But the later comes after , so . This is a cycle. Not serializable.
(B) : comes before and before , and comes before . Every edge is (the final comes after has committed). There is no cycle. Conflict serializable, equivalent to the serial order .
(C) : comes before , so . But comes before the second , so . Cycle. Not serializable.
(D) : comes before , so . But comes before , so . Cycle. Not serializable.
Answer: (B)
(A) : the first comes before , so . But the later comes after , so . This is a cycle. Not serializable.
(B) : comes before and before , and comes before . Every edge is (the final comes after has committed). There is no cycle. Conflict serializable, equivalent to the serial order .
(C) : comes before , so . But comes before the second , so . Cycle. Not serializable.
(D) : comes before , so . But comes before , so . Cycle. Not serializable.
Answer: (B)
Consider the following read-write schedule over three transactions , and , where the subscripts in the schedule indicate transaction IDs:
Which of the following transaction schedules is/are conflict equivalent to ?
Which of the following transaction schedules is/are conflict equivalent to ?
One or more options are correct.
Answer: (B), (C), (D)
Conflicting pairs (same data item, different transactions, and at least one write):
- z: only T1 touches it so T1 does not conflict with any other transaction.
- x: only T2 touches it.
- y: the operations happen before T3 must come before T2.
So every serial order with T3 before T2 is conflict equivalent to S, and T1 can be placed at any position: .
The order has T2 before T3 so it is not equivalent.
Answer: , ,
- z: only T1 touches it so T1 does not conflict with any other transaction.
- x: only T2 touches it.
- y: the operations happen before T3 must come before T2.
So every serial order with T3 before T2 is conflict equivalent to S, and T1 can be placed at any position: .
The order has T2 before T3 so it is not equivalent.
Answer: , ,
Keep practising