Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
START TRANSACTION; UPDATE inventory SET qty = qty - 1 WHERE product_id = 10; SAVEPOINT after_inventory; INSERT INTO shipments (product_id, qty) VALUES (10, 1); -- Something fails: ROLLBACK TO SAVEPOINT after_inventory; -- keeps inventory update -- Or full rollback: ROLLBACK; -- Or commit everything: COMMIT;
Result
Open