Published Jul 30, 2021Updated Sep 9, 2021
Contribute to Docs
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
Note: Except for
COUNT(*), aggregate functions ignore all
List all the years and their number of movies, but only the years with more than 5 movies:
SELECT year,COUNT(*)FROM moviesGROUP BY yearHAVING COUNT(*) > 5;
- 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.
- Anonymous contributorAnonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn SQL on Codecademy
Analyze Data with SQLLearn to analyze data with SQL and prepare for technical interviews.
Includes 8 Courses