Skip to main contentSkip to solution

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().

Keyboard Shortcuts

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