Challenge: Simulate a Transaction Rollback
Task
Swipe to start coding
In this task, you will simulate a failed transaction in SQL and ensure that no changes are saved to the database. This exercise builds on your understanding of transaction logic and data integrity.
- Begin a transaction.
- Update the
balanceforaccount_id = 1001by subtracting 100.00. - Simulate an error that would cause the transaction to fail.
- Roll back the transaction so that the balance remains unchanged.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 4.55
Challenge: Simulate a Transaction Rollback
Swipe to show menu
Task
Swipe to start coding
In this task, you will simulate a failed transaction in SQL and ensure that no changes are saved to the database. This exercise builds on your understanding of transaction logic and data integrity.
- Begin a transaction.
- Update the
balanceforaccount_id = 1001by subtracting 100.00. - Simulate an error that would cause the transaction to fail.
- Roll back the transaction so that the balance remains unchanged.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 6
single