CS FundamentalsEasyWipro · Cognizant technical pattern
Transaction T1 reads a row, transaction T2 then updates that row and commits, and T1 reads the same row again and sees a different value. Which anomaly is this?
- A. Dirty read
- B. Phantom read
- C. Lost update
- D. Non-repeatable read
Correct answer: D. Non-repeatable read
Reading the same row twice and getting different committed values is a non-repeatable read. A dirty read sees uncommitted data; a phantom is a new or vanished row in a range query; a lost update overwrites another transaction’s write.
More DBMS and SQL questions
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- R(A, B, C, D, E) has functional dependencies A → BC, CD → E and B → D. Which of the following is a candidate key?