Skip to course content
Free SQL course

SQL for Data Analysis and AI

Module 04

Aggregation with GROUP BY and HAVING

About 70-90 minutes of guided work.

By the end of this module you can state what one row of an aggregated result represents, choose between WHERE and HAVING for the right reason, and spot two errors that produce confident wrong numbers: averaging averages, and grouping on values that are not as tidy as they look.

Units

  1. Unit 04.00: GROUP BY changes the grain of your result
  2. Unit 04.01: COUNT(*) versus COUNT(column)
  3. Unit 04.02: WHERE before grouping, HAVING after
  4. Unit 04.03: The average-of-averages error
  5. Unit 04.04: Grouping on messy values and what it hides

Module work