Mid SQL

What are aggregate functions in SQL?

Aggregate functions perform a calculation on a set of values and return a single value.

Common aggregate functions include:

  • COUNT(): Returns the number of rows.
  • SUM(): Returns the sum of a column.
  • AVG(): Returns the average of a column.
  • MAX(): Returns the maximum value.
  • MIN(): Returns the minimum value.

Example:

SELECT AVG(salary)

FROM employees;

More from SQL Server Tutorial

All questions for this course