The GROUP BY function is used in SQL to group rows with similar values together. Some of the group functions used are____________.
(A) MAX()
(B) MIN()
(C) SUM()
(D) LENGTH()
The GROUP BY function is used in SQL to group rows with similar values together. Some of the group functions used are____________.
(A) MAX()
(B) MIN()
(C) SUM()
(D) LENGTH()
Solution
✅ Correct Option: 2
MAX(), MIN() and SUM() are aggregate (group) functions. Each takes the values in a group of rows and returns a single result, such as the highest, lowest or total value for each group formed by GROUP BY.
Options 1, 3 and 4: LENGTH() is a single-row (scalar) function. It returns the number of characters in a string for each row separately and does not combine rows, so it is not a group function.
Other common group functions are COUNT() and AVG().
Related questions:
2025: 13 May Shift 2
2025: 13 May Shift 2
2026: 31 May Shift 1