OneBug This week's bugs
Spot the bug SQL
1
-- Every product with its review count this month.
2
-- (products with no reviews should appear with 0)
3
SELECT p.name, COUNT(r.id) AS reviews
4
FROM products p
5
LEFT JOIN reviews r ON r.product_id = p.id
6
WHERE r.created_at >= '2026-07-01'
7
GROUP BY p.name;

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