Skip to main content
Journey Uncommon Logo
JourneyUncommon
easySQLLEFT and RIGHT JOINSingle-choice MCQ

A `customers` LEFT JOIN `orders` is run. A customer with zero orders appears in the result. What does `COUNT(orders.id)` return for that customer when grouped by customer?

SELECT c.id, COUNT(o.id) AS order_count FROM customers c LEFT JOIN orders o ON o.customer_id = c.id GROUP BY c.id;