Use `GROUP BY` to calculate aggregations on columns. Each column or expression in the `SELECT` statement not in the `GROUP BY` clause must be in a group function (e.g., `SUM`).
The `GROUP BY` function calculates after the `WHERE` condition is evaluated.
Use `SUM`, `AVG`, `COUNT`, `MIN`, `MAX` to calculate statistics on grouped rows by passing the function and column name in the `SELECT` statement.
`COUNT(*)` will count records.
`COUNT(<column>)` will return the number of non-null values in a column.
`COUNT(Distinct <column>)` will return number of unique values.