Use transaction block for multiple steps
SQL
Easy
2 views
Problem Description
Insert a customer and an order in one transaction.
Official Solution
BEGIN; INSERT INTO Customers(customer_id, name, city) VALUES (202, 'Riya', 'Jaipur'); INSERT INTO Orders(order_id, customer_id, order_date, status, total_amount) VALUES (9100, 202, CURRENT_DATE, 'NEW', 1500); COMMIT;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!