Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
HAVING. WHERE filters rows before they are grouped. HAVING filters the groups after GROUP BY, so it can test a COUNT or a SUM. The order is always WHERE, then GROUP BY, then HAVING.
select category, avg(list_price) as avg_price from products group by category having avg(list_price) > 20
The account team wants to thank every customer who placed 15 or more completed orders this year.
Return customer_id and the number of completed orders, only for customers with at least 15 completed orders.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe