Skip to main contentSkip to solution

Which of the following are the examples of aggregate functions in SQL?

(A) MAX()

(B) AVG()

(C) SUM()

(D) COUNT(*)

Solution

✅ Correct Option: 3

All four are aggregate functions. An aggregate function works on a set of rows and returns a single value.

MAX() gives the largest value, AVG() the average, SUM() the total, and COUNT(*) the number of rows, including rows with NULL values.


Options 1, 2 and 4: each leaves out a standard aggregate function. COUNT(*) is easy to forget because it takes no column name, but it is still an aggregate.

Aggregate functions (except COUNT(*)) ignore NULL values, and they are often used with GROUP BY.

Keyboard Shortcuts

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