Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSQLdirty phantom non-repeatable readsSingle-choice MCQ

Consider this sequence on PostgreSQL at READ COMMITTED. What value does the final SELECT in session A return, and why?

-- Session A BEGIN; SELECT bal FROM acct WHERE id=1; -- returns 100 -- Session B (concurrent) BEGIN; UPDATE acct SET bal = 500 WHERE id=1; COMMIT; -- Session A continues UPDATE acct SET bal = bal + 1 WHERE id=1; SELECT bal FROM acct WHERE id=1; -- ?