Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSQLisolation levels and anomaliesSingle-choice MCQ

Two transactions run under READ COMMITTED. T1 does UPDATE accounts SET bal = bal - 100 WHERE id = 5. Concurrently T2 does the same statement on id = 5. T2's statement blocks, then T1 commits. What value does T2's UPDATE use as the starting bal, and why?

-- T1 BEGIN; UPDATE accounts SET bal = bal - 100 WHERE id = 5; -- (not yet committed) -- T2 (concurrent) BEGIN; UPDATE accounts SET bal = bal - 100 WHERE id = 5; -- blocks -- then T1 COMMIT; -> T2 unblocks