Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLtransactions BEGIN COMMITSingle-choice MCQ

Inside the transaction below, what does the final SELECT return?

BEGIN; UPDATE accounts SET balance = balance - 100 WHERE id = 1; SAVEPOINT s1; UPDATE accounts SET balance = balance - 50 WHERE id = 1; ROLLBACK TO SAVEPOINT s1; SELECT balance FROM accounts WHERE id = 1; -- balance was 500 before BEGIN COMMIT;