Aggregate Functions

Aggregate Functions

In SQL, aggregate functions perform a calculation on a set of values and return a single value. They are often used with the GROUP BY clause of the SELECT statement.

Note: Except for COUNT(*), aggregate functions ignore all NULL values.

Example

List all the years and their number of movies, but only the years with more than 5 movies:

Loading...

Aggregate Functions

Returns the average value in a column.
Returns the number of rows that match the specified criteria.
Returns the largest value in a column.
Returns the smallest value in a column.
Returns the sum of all the value in that column.
Interested in contributing to Codecademy Docs? Check out our Contribution Guide or leave us some feedback.

Learn SQL on Codecademy