Bird
0
0

Examine this transaction:

medium📝 Debug Q6 of 15
SQL - Transactions and Data Integrity
Examine this transaction:
BEGIN TRANSACTION;
UPDATE inventory SET quantity = quantity - 5 WHERE product_id = 20;
COMMIT;
ROLLBACK;

What is the issue with this sequence?
AROLLBACK should be before COMMIT to save changes.
BROLLBACK has no effect after COMMIT has been executed.
CCOMMIT cannot be used after UPDATE statements.
DBEGIN TRANSACTION is missing a SAVEPOINT.
Step-by-Step Solution
Solution:
  1. Step 1: Understand COMMIT effect

    COMMIT finalizes changes permanently.
  2. Step 2: Role of ROLLBACK after COMMIT

    ROLLBACK cannot undo changes after commit.
  3. Final Answer:

    ROLLBACK has no effect after COMMIT has been executed. -> Option B
  4. Quick Check:

    ROLLBACK ineffective post-COMMIT [OK]
Quick Trick: ROLLBACK cannot undo committed changes [OK]
Common Mistakes:
  • Expecting rollback to undo after commit
  • Misplacing rollback before commit
  • Confusing SAVEPOINT necessity

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes