Delete every order from US customers in one shot
The customer with id = 4 asked us to delete all of their orders. A subquery handles this, but for practice there's a more readable syntax — DELETE joined with another table via USING (reads as a JOIN inside the delete).
From orders remove every row whose customer_id matches a customer with id = 4. After the operation this customer should have no orders left.
Just INSERT/UPDATE/DELETE — no trailing SELECT needed.
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid