Challenge: Simulate a Transaction Rollback
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 4. Kapitel 6
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 4.55
Challenge: Simulate a Transaction Rollback
Stryg for at vise menuen
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 4. Kapitel 6
single