SQL LEARNING PLATFORM
Data integrity — guaranteeing your data is always correct.
Learning Blocks
Interactive Queries
Concepts you'll master
What a transaction is and why it matters
START TRANSACTION, COMMIT, ROLLBACK
ACID: Atomicity, Consistency, Isolation, Durability
SAVEPOINT for partial rollbacks
🌟 Think of it this way: A bank transfer: deduct ₹5,000 from Account A, add ₹5,000 to Account B. If the server crashes after the deduction but before the credit, the money disappears. A transaction guarantees either BOTH operations succeed or NEITHER does — the money cannot vanish.
START TRANSACTION; UPDATE accounts SET balance = balance - 5000 WHERE account_id = 101; UPDATE accounts SET balance = balance + 5000 WHERE account_id = 202; COMMIT; -- only if both succeed -- If anything fails: ROLLBACK; -- reverts both updates completely