CS FundamentalsHardTCS NQT · Infosys interview pattern

Account X holds 100. T1 reads X (100); T2 reads X (100); T1 writes X = 150 and commits; T2 writes X = 80 and commits. What is the final value of X, and what is this anomaly called?

  1. A. 150; lost update
  2. B. 130; dirty read
  3. C. 80; lost update
  4. D. 80; phantom read

Correct answer: C. 80; lost update

T2’s write was based on its stale read and overwrites T1’s committed change, leaving 80. T1’s update is lost. No uncommitted data was read, so it is not a dirty read, and no rows appear or vanish, so it is not a phantom.

More DBMS and SQL questions

Exams that ask this topic