Which of the following are the examples of aggregate functions in SQL?
(A) MAX()
(B) AVG()
(C) SUM()
(D) COUNT(*)
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.
Related questions:
2025: 3 June Shift 2
2025: 30 May Shift 2
2026: 26 May Shift 1
2026: 18 May Shift 2