Transactions & Concurrency
Transactions & Concurrency — Learn about database transactions, ACID properties, isolation levels, and concurrency control. The guide walks through ACID Properties, BEGIN, COMMIT, ROLLBACK, Isolation Levels, Deadlocks. Atomicity — all operations in a transaction succeed or all fail. Consistency — transactions maintain database rules. Isolation — concurrent transactions do not interfere. Durability — committed data survives system failures. These four guarantees make relational databases reliable for critical data. START TRANSACTION (or BEGIN) starts a transaction. All subsequent statements are part of the transaction until COMMIT (make permanent) or ROLLBACK (undo all). SAVEPOINTs allow partial rollback within a transaction. Use transactions for operations that must succeed or fail together, like financial transfers. The guide is organized into 4 sections that build on each other, each pairing a prose explanation with real SQL you can run as-is. Related guides: SQL Introduction, SELECT Statement, WHERE Clause & Operators, SQL JOINs, GROUP BY & Aggregation.