What does the GROUP BY clause do?
- A Sorts the result set
- B Collapses rows sharing a value into a single row so aggregates can be applied
- C Filters rows before selection
- D Joins two tables
Answer
Collapses rows sharing a value into a single row so aggregates can be applied
GROUP BY creates one output row per distinct combination of the grouping columns, which is what allows COUNT, SUM and AVG to be computed per group.





