← SQL Operations CasesMy saved work →
Independent practice · SQLite
Find paid orders with unmatched customer IDs
Your work
Active 0:00 · Paused 0sShow the reference answer
SELECT o.order_id,o.customer_id FROM orders o LEFT JOIN customers c ON o.customer_id=c.customer_id WHERE o.status='paid' AND c.customer_id IS NULL
Order 5 references 99. Cancelled NULL-key order 6 is not paid.