IAE Academy

GATE 2026 CS2 Q.20: solution and answer

GATE 2026 · CS2Q.20 · 1 mark · MCQ

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?

  1. (A)

    Both and only read

  2. (B)

    reads and writes

  3. (C)

    writes and reads

  4. (D)

    Both and write

See the question in the paper

Answer and solution

ANSWER

Option (A): the transactions do not conflict on only when both of them only read .

Official answer: ASource: Official answer key, GATE 2026 CS2 (IIT Guwahati)

  1. Two operations of different transactions on the same data item conflict if at least one of them is a write.

  2. This gives three conflicting pairs on : read-write (), write-read () and write-write ().

  3. Check (B): reads and writes, a read-write pair, so they conflict.

  4. Check (C): writes and reads, a write-read pair, so they conflict.

  5. Check (D): both write, a write-write pair, so they conflict.

  6. Check (A): both only read. A read-read pair is never a conflict, because swapping the two reads changes neither the values read nor the final state of .

  7. So the only way the transactions do not conflict on is that both only read .

KEY IDEA

Two operations conflict when they belong to different transactions, touch the same data item, and at least one is a write. If neither transaction writes, there is no conflict.

WATCH OUT FOR

Treating a read-write or write-read pair as harmless because only one transaction writes. Any single write is enough to make the pair conflict, because swapping the two operations can change what the reader sees or the final value of .

From the GATE 2026 CS2 paper. Every question of this paper · Download the full paper · All 9 Transactions questions, with notes

More Transactions questions