Transactions (ACID)

Understand safe database operations using atomicity, consistency, isolation, and durability.

Transactions (ACID)

Transactions make sure related database changes are completed together. If one step fails, the database can roll back the full operation.

sql
BEGIN;

UPDATE accounts SET balance = balance - 500 WHERE id = 1;
UPDATE accounts SET balance = balance + 500 WHERE id = 2;

COMMIT;
Let's learn with DevBrainBox AI