Skip to content
RED SAGSkills
medium10 pts · first answer countssqljoins

LEFT JOIN that lost customers

customers has 5 rows. orders: customer 1 has one paid and one refunded order, customer 2 has one paid order, customer 3 has one order with status NULL, customers 4 and 5 have none. How many rows does this query return?

SELECT c.id, o.id
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id
WHERE o.status = 'paid';
Choose one answer