Module 04 of 14

Aggregation & Grouping

Lessons

About This Module

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.

Lessons

6 videos
01

Basic Aggregate Functions in SQL (COUNT, SUM, AVG, MAX, and MIN)

An introduction to the five core aggregate functions and how each one summarizes a column of values.

02

Mastering Aggregate Functions in SQL: SUM, AVG, COUNT, MIN, MAX, and More!

A broader look at aggregate functions with worked examples, going beyond the basics of summarizing a table.

03

SQL Aggregate Functions, GROUP BY, and HAVING — Explained Clearly

Ties the pieces together: using aggregates with GROUP BY to summarize by category, then HAVING to filter the groups.

04

SQL: Group By & Having Clause

A focused lesson on grouping rows and filtering groups, including when to use WHERE and when to use HAVING.

05

SQL GROUP BY, HAVING & SUBQUERY Tutorial (For Beginners)

A beginner-friendly walkthrough of GROUP BY and HAVING that also previews how subqueries can feed into grouped results.

06

Want to Master SQL GROUP BY? Watch This Now

A deeper dive into GROUP BY: grouping by multiple columns and avoiding the common mistakes that trip up beginners.