Coding task · SQL and MySQL course · Module 10: Transactions and advanced SQL
A transaction with a rollback
Sometimes we want to test a change and then undo it. Open a transaction, change a book's price, and then roll the change back.
Task
Write a transaction: start it with START TRANSACTION, then UPDATE the ksiazki table set cena = 99 for id = 1, and finally undo the changes with ROLLBACK.