Problem Statement
Which commands are core Transaction Control Language (TCL)?
Explanation
TCL manages the unit of work. COMMIT makes changes permanent. ROLLBACK undoes the unit. SAVEPOINT lets you roll back partway.
DDL often auto-commits in some engines. Be mindful of boundaries so side effects are predictable.
Code Solution
SolutionRead Only
BEGIN; UPDATE accounts SET bal=bal-100 WHERE id=1; SAVEPOINT s1; UPDATE accounts SET bal=bal+100 WHERE id=2; ROLLBACK TO s1; -- optional COMMIT;
Practice Sets
This question appears in the following practice sets:
