GROUP BY combines rows that have the same value and returns one result row for each group. We often use it with COUNT, SUM, or AVG to calculate a metric for each category.
The query itself is usually short, but there are two things we need to check. First, what does one row in the source table represent? Second, what should one row in the result represent?
In this module, we’ll compare item rows, orders, and customers. After that, we’ll change the grouping columns to produce one row per month instead of one row per month and status.



