Complete the SQL statement to start a transaction.
BEGIN [1];The BEGIN TRANSACTION statement starts a new transaction in SQL.
Complete the SQL statement to save changes permanently.
[1] TRANSACTION;The COMMIT TRANSACTION statement saves all changes made during the transaction permanently.
Fix the error in the SQL statement to undo changes in a transaction.
ROLLBACK [1];The correct syntax to undo changes is ROLLBACK TRANSACTION.
Fill both blanks to create a savepoint and rollback to it.
SAVEPOINT [1]; ROLLBACK TO [2];
You create a savepoint named sp1 and rollback to the same savepoint sp1.
Fill all three blanks to demonstrate atomicity with a transaction.
BEGIN [1]; UPDATE accounts SET balance = balance - 100 WHERE id = 1; UPDATE accounts SET balance = balance + 100 WHERE id = 2; [2]; [3];
This code starts a transaction, updates balances, commits the changes, and includes a rollback option to undo if needed, demonstrating atomicity.
