Individual rows rarely answer business questions — totals, averages, and counts do. This module covers the aggregate functions COUNT, SUM, AVG, MIN, and MAX, which collapse many rows into a single summary value.
You'll then split those summaries by category with GROUP BY, filter the resulting groups with HAVING, and learn the difference between WHERE (filtering rows before grouping) and HAVING (filtering groups after). Along the way you'll see how COUNT(DISTINCT) works and how NULL values are treated inside aggregates.
Work through the lessons in order, then continue on to Joins.
An introduction to the five core aggregate functions and how each one summarizes a column of values.
A broader look at aggregate functions with worked examples, going beyond the basics of summarizing a table.
Ties the pieces together: using aggregates with GROUP BY to summarize by category, then HAVING to filter the groups.
A focused lesson on grouping rows and filtering groups, including when to use WHERE and when to use HAVING.
A beginner-friendly walkthrough of GROUP BY and HAVING that also previews how subqueries can feed into grouped results.
A deeper dive into GROUP BY: grouping by multiple columns and avoiding the common mistakes that trip up beginners.