Transactions
A transaction groups statements so they all succeed or all roll back.
Example
BEGIN;
UPDATE students SET score = 100 WHERE id = 1;
ROLLBACK;
SELECT score FROM students WHERE id = 1;Result
score 92
Exercise
Undo changes.
;Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.