CS FundamentalsVery hardProduct company interview · GATE level

Consider the schedule R2(A); R3(B); W1(A); R2(C); W1(C); W2(B); R4(A); W4(C). Which statement is correct?

  1. A. It is conflict serializable, and the only equivalent serial order is T3, T2, T1, T4
  2. B. It is conflict serializable, and the only equivalent serial order is T2, T3, T1, T4
  3. C. It is conflict serializable, and both T3, T2, T1, T4 and T2, T3, T1, T4 are equivalent serial orders
  4. D. It is not conflict serializable

Correct answer: A. It is conflict serializable, and the only equivalent serial order is T3, T2, T1, T4

Precedence edges: R2(A) before W1(A) gives T2 → T1. R3(B) before W2(B) gives T3 → T2. R2(C) before W1(C) gives T2 → T1 again. W1(A) before R4(A) gives T1 → T4, and R2(C), W1(C) before W4(C) give T2 → T4 and T1 → T4. The graph T3 → T2 → T1 → T4 (plus T2 → T4) has no cycle, so the schedule is conflict serializable, and its only topological order is T3, T2, T1, T4. T2 cannot come before T3 because T3 read B before T2 overwrote it.

More DBMS and SQL questions

Exams that ask this topic