Skip to main contentSkip to solution

Which of the following statement is CORRECT about GROUP BY clause in SQL?

Solution

✅ Correct Option: 3

GROUP BY collects rows that have the same value in the specified column(s) into groups. It is usually combined with aggregate functions such as SUM, AVG, COUNT, MAX and MIN, so each group returns one summary row. For example, SELECT dept, COUNT(*) FROM emp GROUP BY dept; gives the number of employees in each department.


Option 1: sorting is done by ORDER BY, not GROUP BY. Grouped output may appear sorted in some systems, but that is not its purpose.

Option 2: this reverses the truth. Aggregate functions are the main reason to use GROUP BY.

Option 4: combining tables is done by JOIN (or UNION for result sets).

Use WHERE to filter rows before grouping and HAVING to filter groups after grouping.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question