CS FundamentalsHardProduct-company MCQ pattern

How many of the following statements are correct? 1. A phantom read occurs when re-running a query with the same predicate returns new rows inserted and committed by another transaction. 2. Two-phase locking on individual rows alone is enough to prevent phantoms. 3. Lost updates can happen under READ UNCOMMITTED. 4. Snapshot isolation prevents dirty reads and non-repeatable reads but allows write skew.

  1. A. Only one
  2. B. Only two
  3. C. Only three
  4. D. All four

Correct answer: C. Only three

1, 3 and 4 are correct. 2 is false: row locks cannot lock rows that do not exist yet; preventing phantoms needs predicate, index-range (next-key) or table locks.

More DBMS and SQL questions

Exams that ask this topic