Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
-- Atomicity: both updates happen or neither does -- Consistency: foreign keys and CHECK constraints still apply -- Isolation: other sessions see the old balance until COMMIT -- Durability: after COMMIT, the change survives a server restart START TRANSACTION; INSERT INTO orders (user_id, total) VALUES (1, 99.99); INSERT INTO order_items (order_id, product_id, qty) VALUES (LAST_INSERT_ID(), 5, 2); COMMIT;
Result
Open