- All Courses
- PostgreSQL for Developers
- SQL Essentials
- Aggregates and GROUP BY
Aggregates and GROUP BY
Aggregation collapses rows into summaries. WHERE filters before grouping and HAVING after — mixing them up is the classic bug.
- 6m
- Intermediate

Video by Becoming a Data Scientist · YouTube
Check your understanding
3 questions. Unlocks when you finish the video.
Overview
What this lesson covers
- Aggregate with count, sum, avg, min, and max
- Group correctly and know what must be in GROUP BY
- Filter groups with HAVING, rows with WHERE
This lesson sits in SQL Essentials, part of PostgreSQL for Developers. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will:
- Aggregate with count, sum, avg, min, and max
- Group correctly and know what must be in GROUP BY
- Filter groups with HAVING, rows with WHERE
Resources
Your notes will live here
Note taking is not available yet. Nothing you type would be saved, so the tab stays read-only for now.