Transactions
Question 1 |
S1: r1(x) r1(y) r2(x) r2(y) w2(y) w1(x)
S2: r1(x) r2(x) r2(y) w2(y) r1(y) w1(x)
Which one of the following options is correct?
S1is not conflict serializable, and S2 is conflict serializable. | |
Neither S1nor S2is conflict serializable.
| |
Both S1and S2are conflict serializable. | |
S1is conflict serializable, and S2is not conflict serializable. |

Question 2 |
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?
![]() | |
![]() | |
![]() | |
![]() |
• First, let’s list the conflict operations of each of the schedule given in the options and compare with the conflict operations of schedule which is given in the question.
Given schedule:

Conflict operations:
R2(B) → W1(B)
W2(B) → W1(B)
R1(C) → W2(C)
R2(D) → W1(D)
Option(1):

Conflict operations:
R1(C) → W2(C)
W1(D) → R2(D)
W1(B) → R2(B)
W1(B) → W2(B)
Option(2):

Conflict operations:
R2(B) → W1(B)
W2(B) → W1(B)
R2(D) → W1(D)
R1(C) → W2(C)
Option(3):

Conflict operations:
R2(B) → W1(B)
W2(B) → W1(B)
R2(D) → W1(D)
W2(C) → R1(C)
Option(4):

Conflict operations:
R1(C) → W2(C)
W1(D) → R2(D)
R2(B) → W1(B)
W2(B) → W1(B)
The conflict operations in the option (2) and given schedule are appearing in the same sequence order, so option (2) is the answer.
Question 3 |
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?
Both I and II | |
Neither I nor II | |
II only | |
I only |
In strict 2PL, a transaction T does not release any of its exclusive (write) locks until after it commits or aborts.
Hence, no other transaction can read or write an item that is written by T unless T has committed, leading to a strict schedule for recoverability.
(Ref: Fundamentals of Database Systems by Elmasri and Navathe, 7e Pg. No. 789)
By ignoring the write, Thomas write rule allows schedules that are not conflict serializable but are nevertheless correct.
Those non-conflict-serializable schedules allowed satisfy the definition of view serializable schedules.
(Ref: Database System Concepts by Silberschatch, Korth and Sudarshan, 6e Pg No. 686)
Question 4 |
1 Read A
2 Read B
3 Write A
4 Read A
5 Write A
6 Write B
7 Read B
8 Write B
This schedule is serialized and can occur in a scheme using 2PL protocol | |
This schedule is serializable but cannot occur in a scheme using 2PL protocol | |
This schedule is not serialiable but can occur in a scheme using 2PL protocol | |
This schedule is not seralisable and cannot occur in a scheme using 2PL protocol. |

Since cycle exist so not conflict serializable.
And we know that if the schedule is not serializable then it is not 2PL.
Hence correct option is (D).
Question 5 |
R2(Y), R1(X), R3(Z), R1(Y), W1(X), R2(Z), W2(Y), R3(X), W3(Z)
Consider the statements P and Q below:
P: S is conflict-serializable.
Q: If T3commits before T1finishes, then S is recoverable.
Which one of the following choices is correct?
P is true and Q is false. | |
Both P and Q are false. | |
Both P and Q are true. | |
P is false and Q is true. |

Question 6 |
S: R4(x) R2(x) R3(x) R1(y) W1(y) W2(x) W3(y) R4(y)
Which one of the following serial schedules is conflict equivalent to S
![]() | |
![]() | |
![]() | |
![]() |

Precedence Graph

T1 → T3 → T4 → T2
Question 7 |
Consider the following two transactions: T1 and T2.
T1: read(A); read(B); if A=0 then B ← B+1; write(B); T2: read(B); read(A); if B≠0 then A ← A-1; write(A);Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?
![]() | |
![]() | |
![]() | |
![]() |
i) Exclusive locks should be released after the commit.
ii) No locking can be done after the first unlock.
(A) Wrong because to write x you need Exclusive Lock.
(B) Wrong because violating the 1st requirement.
(C) Correct.
(D) Wrong because violating the 1st requirement.
Question 8 |
Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the following NYO represents the action Y (R for read, W for write) performed by transaction N on object O.]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB (S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC (S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WBWhich of the following statements is TRUE?
S1, S2 and S3 are all conflict equivalent to each other | |
No two of S1, S2 and S3 are conflict equivalent to each other | |
S2 is conflict equivalent to S3, but not to S1 | |
S1 is conflict equivalent to S2, but not to S3 |
For S1:

For S2:

For S3:

Hence, S1 is conflict equivalent to S2, but not to S3.
Question 9 |
Consider three data items D1, D2 and D3 and the following execution schedule of transactions T1, T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data item D respectively.

Which of the following statements is correct?
The schedule is serializable as T2; T3; T1
| |
The schedule is serializable as T2; T1; T3 | |
The schedule is serializable as T3; T2; T1 | |
The schedule is not serializable |

Cycle formed so not serializable.
Question 10 |
Which of the following scenarios may lead to an irrecoverable error in a database system?
A transaction writes a data item after it is read by an uncommitted transaction | |
A transaction reads a data item after it is read by an uncommitted transaction | |
A transaction reads a data item after it is written by a committed transaction | |
A transaction reads a data item after it is written by an uncommitted transaction
|
Question 11 |
Consider the following partial Schedule S involving two transactions T1 and T2. Only the read and the write operations have been shown. The read operation on data item P is denoted by read(P) and the write operation on data item P is denoted by write(P).

T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction atomicity | |
Schedule S is non-recoverable and cannot ensure transaction atomicity | |
Only T2 must be aborted and then re-started to ensure transaction atomicity | |
Schedule S is recoverable and can ensure atomicity and nothing else needs to be done |
Question 12 |
Consider a simple checkpointing protocol and the following set of operations in the log.
-
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list
Undo T3, T1; Redo T2 | |
Undo T3, T1; Redo T2, T4 | |
Undo: none; redo: T2, T4, T3, T1 | |
Undo T3, T1; T4; Redo: T2
|
Question 13 |
Consider the following transaction involving two bank account x and y.
read(x); x:= x-50; write(x); read(y); y:= y+50; write(y)The constraint that the sum of the accounts x and y should remain constant is that of
Atomicity | |
Consistency | |
Isolation | |
Durability |
Question 14 |
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2
where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z) denotes a write operation by Ti on a variable Z and ai denotes an abort by transaction Ti.
Which one of the following statements about the above schedule is TRUE?
S is non-recoverable | |
S is recoverable, but has a cascading abort | |
S does not have a cascading abort | |
S is strict |

Now let's check statements one by one,
A) False, because there is no dirty read. So, it is recoverable.
B) False, because there is to dirty read. So, no cascading aborts.
C) True.
D) False, because there is Transaction T2 which written the value of x which is written by T1 before T1 has aborted. So, not strict.
Question 15 |
Suppose a database schedule S involves transactions T1, ..., Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
Topological order | |
Depth-first order | |
Breadth-first order | |
Ascending order of transaction indices |
But BFS and DFS are also possible for cyclic graphs.
And topological sort is not possible for cyclic graph.
Moreover option (D) is also wrong because in a transaction with more indices might come before lower one.
Question 16 |
Atomicity | |
Consistency | |
Isolation | |
Deadlock-freedom |
So, Deadlock – freedom is not there in the ACID properties.
Question 17 |
T1: r1(X)w1(X)r1(Y)w1(Y)
T2: r2(Y)w2(Y)r2(Z)w2(Z)
where ri(V) denotes a read operation by transaction Ti on a variable V and wi(V) denotes a write operation by transaction Ti on a variable V. The total number of conflict serializable schedules that can be formed by T1 and T2 is ____________.
54 | |
55 | |
56 | |
57 |
= 8!/(4×3×2×4×3×2)
= (8×7×6×5×4×3×2×1)/(4×3×2×4×3×2)
= 70
Following two conflict actions are possible:


∴# Permutations = 4 × 3 = 12

#permutations = 4 × 1 = 4
∴ Total no. of conflict serial schedules possible = 70 - 12 - 4 = 54
Question 18 |
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x) and w(x) respectively. Which one of them is conflict serializable?
r1 (x); r2 (x); w1 (x); r3 (x); w2 (x) | |
r2 (x);r1 (x);w2 (x);r3 (x);w1 (x) | |
r3 (x);r2 (x);r1 (x);w2 (x);w1 (x) | |
r2 (x);w2 (x);r3 (x);r1 (x);w1 (x) |

- Polygraph contains cycle. So, not a conflict serializable.
Option: B

-Cyclic
Option: C

- Cyclic
Option: D

- Acyclic, so conflict serializable.
Question 19 |
Consider the following schedules involving two transactions. Which one of the following statements is TRUE?
- S1: r1(X); r1(Y); r2(X); r2(Y); w2(Y); w1(X)
S2: r1(X); r2(X); r2(Y); w2(Y); r1(Y); w1(X)
Both S1 and S2 are conflict serializable. | |
S1 is conflict serializable and S2 is not conflict serializable. | |
S1 is not conflict serializable and S2 is conflict serializable. | |
Both S1 and S2 are not conflict serializable. |

In precedence graph of S1 since cycle is formed so not conflict serializable.
But in precedence graph of S2 No cycle is formed so it is conflict serializable.
Question 20 |
Consider the following schedule for transactions T1, T2 and T3:
Which one of the schedules below is the correct serialization of the above?
T1 → T3 → T2 | |
T2 → T1 → T3 | |
T2 → T3 → T1 | |
T3 → T1 → T2 |

― Precedence graph for the above schedule is,

― From the precedence graph the correct serialization is,

Question 21 |
Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock?
I. 2-phase locking II. TIme-stamp ordering
I only | |
II only | |
Both I and II | |
Neither I nor II |
― Timestamp ordering protocol ensures conflict serializability and free from deadlock.
Question 22 |
Consider the following schedule S of transactions T1, T2, T3, T4:

Which one of the following statements is CORRECT?
S is conflict-serializable but not recoverable | |
S is not conflict-serializable but is recoverable | |
S is both conflict-serializable and recoverable | |
S is neither conflict-serializable nor is it recoverable |

In the precedence graph, there are no cycles. So, it is conflict serializable and recoverable also.