OneBug This week's bugs
Spot the bug SQL
1
-- Count how many orders each customer has placed.
2
SELECT customer_id, COUNT(coupon_code) AS orders
3
FROM orders
4
GROUP BY customer_id;

Read the full write-up for this bug (spoilers)