GateAI
Transactions and Concurrency Control

GATE CSE 2021 Set 2 · Q32

MCQ2 marksMedium

Time

Let S be the following schedule of operations of three transactions T1T_1, T2T_2 and T3T_3 in a relational database system: R2(Y),R1(X),R3(Z),R1(Y),W1(X),R2(Z),W2(Y),R3(X),W3(Z)R_2(Y), R_1(X), R_3(Z), R_1(Y), W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z) Consider the statements P and Q below: P: S is conflict-serializable. Q: If T3T_3 commits before T1T_1 finishes, then S is recoverable. Which one of the following choices is correct?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) P is true and Q is false.

Transactions and Concurrency Control

To evaluate statement P (Conflict Serializability), we identify all conflicting pairs of operations belonging to different transactions:

  1. On data item XX:

    • W1(X)W_1(X) occurs before R3(X)R_3(X), giving the directed edge T1→T3T_1 \to T_3.

  2. On data item YY:

    • R1(Y)R_1(Y) occurs before W2(Y)W_2(Y), giving the directed edge T1→T2T_1 \to T_2.

  3. On data item ZZ:

    • R2(Z)R_2(Z) occurs before W3(Z)W_3(Z), giving the directed edge T2→T3T_2 \to T_3.

The edges in the precedence (serialization) graph are:

T1→T2,T2→T3,T1→T3T_1 \to T_2, \quad T_2 \to T_3, \quad T_1 \to T_3

Since there are no cycles in the precedence graph, the schedule SS is conflict-serializable (with serializability order T1→T2→T3T_1 \to T_2 \to T_3). Hence, P is true.

To evaluate statement Q (Recoverability):

  • Transaction T3T_3 reads XX after T1T_1 writes XX (W1(X)…R3(X)W_1(X) \dots R_3(X)), which means T3T_3 reads dirty (uncommitted) data written by T1T_1.

  • For a schedule to be recoverable, any transaction TjT_j that reads a value written by transaction TiT_i must commit only after TiT_i commits.

  • If T3T_3 commits before T1T_1 commits/finishes and T1T_1 subsequently aborts, the database enters an inconsistent, unrecoverable state.

  • Thus, the schedule is not recoverable under this condition. Hence, Q is false.

Therefore, P is true and Q is false (Option B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Transactions and Concurrency Control previous year question is Q32 of the GATE CSE 2021 Set 2 paper. Find more GATE CSE PYQs on Transactions and Concurrency Control in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Transactions and Concurrency Control PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Transactions and Concurrency Control in GATE CSE

Transactions and Concurrency Control has 25 GATE CSE PYQs across 20 papers from 2012 to 2026. 12 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2021 Set 2.

How GATE tests Transactions and Concurrency Control

More from GATE CSE 2021 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 2 · Q32 · MCQ

Let S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system: 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 T3 commits before T1 finishes, then S is recoverable. Which one of the following choices is correct?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.