Error Handling in a Procedure
Hard
Procedural SQL
Write a procedure that deletes a customer and all of their orders in one transaction and rolls everything back if any statement fails.
Table schema
Customers(id INT PRIMARY KEY, name VARCHAR(50))
Orders(id INT PRIMARY KEY, customer_id INT)Sample data
Call: CALL delete_customer(5);
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.