22
Transactions
•Enroll “Mary Johnson” in “CSE444”:
•
BEGIN TRANSACTION;
INSERT INTO Takes
    SELECT Students.SSN, Courses.CID
    FROM Students, Courses
    WHERE Students.name = ‘Mary Johnson’ and
                   Courses.name = ‘CSE444’
-- More updates here....
IF everything-went-OK
      THEN COMMIT;
ELSE ROLLBACK
If system crashes, the transaction is still either committed or aborted