Bird
0
0

Why does a ROLLBACK command not undo changes after a COMMIT in a transaction?

hard📝 Conceptual Q10 of 15
SQL - Transactions and Data Integrity
Why does a ROLLBACK command not undo changes after a COMMIT in a transaction?
ABecause ROLLBACK only works before BEGIN TRANSACTION
BBecause ROLLBACK requires a SAVEPOINT to work
CBecause COMMIT permanently saves changes, ending the transaction
DBecause COMMIT delays saving changes until session ends
Step-by-Step Solution
Solution:
  1. Step 1: Understand COMMIT effect

    COMMIT permanently saves all changes and closes the transaction.
  2. Step 2: Effect on ROLLBACK

    After COMMIT, no active transaction exists, so ROLLBACK cannot undo changes.
  3. Final Answer:

    Because COMMIT permanently saves changes, ending the transaction -> Option C
  4. Quick Check:

    COMMIT ends transaction; ROLLBACK after has no effect [OK]
Quick Trick: COMMIT ends transaction; ROLLBACK after can't undo [OK]
Common Mistakes:
  • Thinking ROLLBACK works after COMMIT
  • Believing ROLLBACK needs SAVEPOINT always
  • Misunderstanding COMMIT timing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes