Day 2 of 45 · SQL Masterclass · Free
Day 2: Aggregation
Calculate category-level revenue, customer spending tiers, and daily GMV across ShopKart orders.
About 60 minutes of learning and 90 minutes of practice. It runs in your browser, with no install.
What you will be able to do
- Group rows by business keys and calculate metrics using COUNT, SUM, AVG, MIN, and MAX.
- Differentiate WHERE row filters from HAVING post-aggregation group filters.
- Avoid the NULL counting trap with COUNT(*) versus COUNT(column).
What the day covers
GROUP BY, HAVING, COUNT, COUNT DISTINCT, SUM, AVG, MIN/MAX.
Questions you should be able to answer afterwards
- What is the difference between COUNT(*) and COUNT(column_name)?
- When must you use HAVING instead of WHERE?
- How does AVG() handle NULL values in a column?
Practice this day's skills
Each page shows the idea moving, then lists problems from easiest.
Builds on Day 1.
Days 1 to 7 are free. Days 8 to 45 need a pass; the plan page lists what each day covers, and the glossary defines each term.