What does GROUP BY do in a query?

Study for the IT Operations Management (ITOM) Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

What does GROUP BY do in a query?

Explanation:
Grouping by a set of columns combines rows that share the same values in those columns, and then you typically apply aggregates to produce one result per group, i.e., subtotals for each group. This is why it yields multiple lines—one for each distinct combination of the grouping columns—rather than a single row. It’s not about sorting (that’s ORDER BY) or filtering (that’s WHERE). For example, selecting department and total salary with GROUP BY department returns one row per department with the sum of salaries for that department.

Grouping by a set of columns combines rows that share the same values in those columns, and then you typically apply aggregates to produce one result per group, i.e., subtotals for each group. This is why it yields multiple lines—one for each distinct combination of the grouping columns—rather than a single row. It’s not about sorting (that’s ORDER BY) or filtering (that’s WHERE). For example, selecting department and total salary with GROUP BY department returns one row per department with the sum of salaries for that department.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy