bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL Aggregate Functions

Flash cards

Review the key moves

1/3
Core idea

What is the main idea behind SQL Aggregate Functions?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Order

Put the learning moves in the order that makes the concept easiest to apply.

Aggregate functions are often used with the GROUP BY clause of the SELECT statement.
An aggregate function is a function that performs a calculation on a set of values, and returns a single value.
SQL Aggregate Functions

An aggregate function is a function that performs a calculation on a set of values, and returns a single value.

Aggregate functions are often used with the GROUP BY clause of the SELECT statement. The GROUP BY clause splits the result-set into groups of values and the aggregate function can be used to return a single value for each group.

The most commonly used SQL aggregate functions are:

  • MIN() - returns the smallest value of a column
  • MAX() - returns the largest value of a column
  • COUNT() - returns the number of rows in a set
  • SUM() - returns the sum of a numerical column
  • AVG() - returns the average value of a numerical column

Aggregate functions ignore null values (except for COUNT(*) ).

We will go through the aggregate functions above in the next chapters.

Previous

SQL SELECT TOP, LIMIT and FETCH FIRST

Next

SQL MIN() F unction