If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

SQL: SELECT with aggregate functions

SQL provides several aggregate functions for making calculations based on columns: AVG, MAX/MIN, SUM, and COUNT. You can use those by typing the function names, then putting the column name or * inside parentheses.
To eliminate duplicates sent to the function, you can type DISTINCT before the column name inside the parentheses. This is particularly useful with COUNT, as shown before.
For more details, see the SQLite reference for aggregate functions.
▶️ You can also learn about this in our Aggregating data talkthrough.

Want to join the conversation?

No posts yet.