GROUP BY over multiple columns
When there are multiple columns in a
GROUP BY clause, each unique combination of values in all those columns creates a separate group, over which the aggregate function is applied.
In the above data and the query that follows it,
course Java and
grade 1 is a unique group, which has 2 students (
Tonya) under it. Similarly,
grade 6 is another unique group with just 1 student (
Johnson) under it.
grade 9 to create another unique group, with 1 student (
Tony) under it.