Multiple choice technology databases

Which of the following correctly describe the aggregate functions?

  1. It returns a single result row based on single rows

  2. It returns a single result row based on groups of rows

  3. It can only appear in ORDER BY clauses

  4. It cannot appear in select lists

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Aggregate functions (SUM, COUNT, AVG, MAX, MIN) operate on groups of rows and return a single result row per group. When used without a GROUP BY clause, they treat all rows as one group and return one result row. When used with GROUP BY, they return one row per unique group. Option B correctly captures this behavior. Option A is wrong because aggregates work on sets of rows, not single rows. Options C and D are incorrect because aggregates appear in SELECT lists, HAVING, and ORDER BY (with restrictions), not just ORDER BY.