SQL - Transactions and Data IntegrityWhy does a ROLLBACK command not undo changes after a COMMIT in a transaction?ABecause ROLLBACK only works before BEGIN TRANSACTIONBBecause ROLLBACK requires a SAVEPOINT to workCBecause COMMIT permanently saves changes, ending the transactionDBecause COMMIT delays saving changes until session endsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand COMMIT effectCOMMIT permanently saves all changes and closes the transaction.Step 2: Effect on ROLLBACKAfter COMMIT, no active transaction exists, so ROLLBACK cannot undo changes.Final Answer:Because COMMIT permanently saves changes, ending the transaction -> Option CQuick 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 COMMITBelieving ROLLBACK needs SAVEPOINT alwaysMisunderstanding COMMIT timing
Master "Transactions and Data Integrity" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Query Patterns - Date range overlap detection - Quiz 3easy Advanced Window Functions - NTH_VALUE function - Quiz 9hard Advanced Window Functions - NTH_VALUE function - Quiz 2easy Common Table Expressions (CTEs) - Recursive CTE for hierarchical data - Quiz 9hard Common Table Expressions (CTEs) - Multiple CTEs in one query - Quiz 1easy Database Design and Normalization - First Normal Form (1NF) - Quiz 5medium Database Design and Normalization - Database design best practices - Quiz 14medium Triggers - Trigger performance considerations - Quiz 4medium Triggers - Trigger for audit logging - Quiz 10hard Window Functions Fundamentals - OVER clause with PARTITION BY - Quiz 12easy