Skip to main contentSkip to solution

__________group the rows together that contains the same value in a specified column.

Solution

✅ Correct Option: 2

The GROUP BY clause in SQL groups together the rows that have the same value in a specified column. Aggregate functions such as SUM, COUNT or AVG are then applied to each group, giving one result row per group.

Example: SELECT dept, COUNT(*) FROM emp GROUP BY dept;\text{SELECT dept, COUNT(*) FROM emp GROUP BY dept;} gives one row per department with its employee count.


Option 1: an aggregate function calculates a single value (such as SUM or MAX) from a set of rows. It works on groups but does not form them.

Option 3: ORDER BY only sorts the result rows. It does not combine rows with equal values.

Option 4: a scalar function works on a single value and returns a single value (such as UPPER or LEN), so it does not group rows.

Keyboard Shortcuts

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