Coding task · SQL and MySQL course · Module 10: Transactions and advanced SQL
A safe book return
A return is also two operations together: recording the return date and making the book available again. Wrap them in a transaction.
Task
Write a transaction: start it with START TRANSACTION, then UPDATE the wypozyczenia table set data_zwrotu = '2026-06-22' for id = 1, then UPDATE the ksiazki table set dostepna = 1 for id = 1, and finally confirm the changes with COMMIT.