CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
T1 reads the balance of account 7, then T2 updates that same row and commits, then T1 reads the row again and sees a different value. No rows are inserted or deleted. What is the lowest SQL-standard isolation level for T1 that rules this out?
- A. READ COMMITTED
- B. SERIALIZABLE
- C. READ UNCOMMITTED
- D. REPEATABLE READ
Correct answer: D. REPEATABLE READ
This is a non-repeatable read of an existing row. READ COMMITTED allows it; REPEATABLE READ forbids it (it still allows phantoms, which need new rows matching a predicate). SERIALIZABLE also prevents it but is not the lowest.
More DBMS and SQL questions
- No transaction has committed. T1 writes A; T2 reads A and writes B; T3 reads B; T4 reads C, which only T5 wrote; T5 reads nothing written…
- A table has 1,000,000 rows in 10,000 blocks. A range predicate selects 20% of the rows, which are spread evenly across the table. There is…
- Table T(a, b, c) has a composite B+ tree index on (a, b), and the query is SELECT b FROM T WHERE a = 5. What is the main benefit of this…
- In extendible hashing, the global depth is 3 and a full bucket with local depth 2 must split on an insert. What happens?
- R(Emp, Skill, Lang) satisfies Emp ↠ Skill (so also Emp ↠ Lang), and it is decomposed into the 4NF relations (Emp, Skill) and (Emp, Lang)…
- R(a) = {1, 2, 3} and S(a) = {2, 3, 3, 4} (S is a bag). How many rows does SELECT FROM R FULL OUTER JOIN S ON R.a = S.a return? (Checked in…