Under standard DBMS transaction theory used in basic SQL classification, which…
2023
Under standard DBMS transaction theory used in basic SQL classification, which of the following commands is generally rollback-able before COMMIT?
- A.
SELECT
- B.
COMMIT
- C.
DELETE
- D.
CREATE
- E.
ALTER
Attempted by 40 students.
Show answer & explanation
Correct answer: C
Concept
SQL commands fall into categories that behave differently inside a transaction. DML commands (INSERT, UPDATE, DELETE) only stage row-level changes, so they remain part of the open transaction and can be undone with ROLLBACK until COMMIT. DDL commands (CREATE, ALTER, DROP) carry an implicit COMMIT in standard SQL, so they finalise immediately and cannot be rolled back. SELECT reads data without changing it, and COMMIT is the act of finalising — neither leaves anything to undo.
Applying it
Classify each command: SELECT is a read (DQL), COMMIT is transaction-control (TCL), CREATE and ALTER are DDL, DELETE is DML.
Apply the transaction rule: only DML changes are held open and reversible before COMMIT.
DELETE is the only DML command among the choices, so it is the command that ROLLBACK can undo before COMMIT.
Cross-check
SELECT: returns rows but writes nothing, so there is no change for ROLLBACK to reverse.
COMMIT: permanently finalises the transaction; once issued there is no pending work left to undo.
CREATE / ALTER: DDL statements trigger an implicit COMMIT in standard SQL, finalising the schema change on execution.
DELETE: stages row removals within the transaction, which ROLLBACK restores while the transaction is still open.