Code QuizIntermediate

COUNT aggregate basics (COUNT(*) vs COUNT(column))

Learn why COUNT(column) can silently undercount rows compared to COUNT(*) when NULLs are present.

Codesql
-- Goal: report the TOTAL number of orders per customer
SELECT customer_id,
       COUNT(shipped_date) AS total_orders
FROM orders
GROUP BY customer_id;

The report is supposed to show every order per customer, but some customers show fewer orders than they actually placed. What is the bug?