CS FundamentalsVery hardGATE CS (PYQ pattern)

Transaction T1 executes R1(A), W1(A), R1(B) and T2 executes W2(A), R2(B), W2(B), each in the stated order (no commits modelled). Among all possible interleavings of the six operations, how many are conflict-serializable?

  1. A. 13
  2. B. 9
  3. C. 6
  4. D. 2

Correct answer: B. 9

There are C(6,3) = 20 interleavings. On item A, R1(A) and W1(A) conflict with W2(A); on item B only R1(B) conflicts with W2(B) (R2(B) and R1(B) do not conflict). A schedule is serializable exactly when all conflicts point the same way; counting those gives 9.

More DBMS and SQL questions

Exams that ask this topic