SQL for Data Analytics · Aggregation

Aggregation

This unit

This unit covers aggregate functions and GROUP BY. An aggregate function is a calculation over a whole column: COUNT, SUM, AVG, MIN, MAX. It gives you one number back, like the total number of orders or the average price. GROUP BY runs that calculation once for each group instead, like the number of orders for each employee. A lot of what people ask of a database is one of those two things.

There are five lessons, and each one works the same way as the last unit:

  1. Watch the video. There's a query box right under it. When I tell you in the video to try something, use that box. If the video uses a table that isn't in Northwind, the box already has it.
  2. Try it. One or two short questions after the video to check yourself. They aren't recorded or part of your unit submission.

The lessons:

  • Null Values (4 min)
  • Aggregate Functions (10 min)
  • GROUP BY (13 min)
  • HAVING (5 min)
  • Query Order (11 min)

When you've finished the lessons, do the Practice for this unit. It's fifteen questions in two parts: ten queries to write, then five questions where you use queries to answer something. This is what you will turn in on Canvas.