12A
Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.
Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.
-- 12a: Repair a left join filter
SELECT c.customer_id,c.customer_name,COUNT(o.order_id) AS completed_orders
FROM aabha_sql.customers AS c
LEFT JOIN aabha_sql.orders AS o
ON o.customer_id=c.customer_id AND o.status='completed'
GROUP BY c.customer_id,c.customer_name ORDER BY c.customer_id;