Predict Transaction Outcome
Predict Output Medium
Question
Account A has 100. After: BEGIN; UPDATE SET balance=balance-30; COMMIT; what is A's balance?
Code
BEGIN;
UPDATE accounts SET balance = balance - 30 WHERE id = 'A';
COMMIT;
Hint
COMMIT makes the change permanent.
Explanation
The transaction deducts 30 from A's balance (100 - 30 = 70). COMMIT makes this permanent, so A's balance is 70.
Related Resources
Related Lessons
- Transactions
Learn COMMIT.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.