Practice mode DBMS and SQL

Inside a transaction you run two UPDATE statements and then realise they were wrong. Which command undoes all changes made since the transaction began?

Correct answer D. ROLLBACK

Explanation

ROLLBACK aborts the current transaction and discards every change made since it began, restoring the state before BEGIN. COMMIT does the opposite: it makes the changes permanent and visible to other sessions. SAVEPOINT only marks a point inside the transaction that you can later roll back to partially. COMMIT, ROLLBACK and SAVEPOINT together form the Transaction Control Language (TCL).

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.