Computer Science for IGCSE & O level - Databases (Section 6 - No. 21)

What is the primary function of the `GROUP BY` clause in SQL?
To sort the results of a query.
To filter the results of a query.
To aggregate data based on one or more columns.
To specify the table to query.

Explanation

The `GROUP BY` clause is used to group rows that have the same values in specified columns, enabling aggregate functions (like `SUM`, `AVG`, etc.) to be applied to each group.

Comments (0)

Advertisement