Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
SQL Min and Max | SQL Aggregate Functions
SQL Tutorial for Beginners
course content

Conteúdo do Curso

SQL Tutorial for Beginners

SQL Tutorial for Beginners

1. Database & Introduction to Syntax
2. SQL Aggregate Functions
3. Filtering Statements

SQL Min and Max

Aggregate Functions

There are functions in SQL that returns single line result among a group of the rows. These functions are called aggregate functions.

MIN() and MAX() functions return the minimum and maximum result from the query, and this is always a single line.

Let's find the release date of the oldest song in our table:

1
SELECT MIN(year) FROM songs
copy

Now, let's select the price of the most expensive song of 21st century:

12
SELECT MAX(price) FROM songs WHERE year > 2000
copy

Tarefa

Find the price of the most expensive song.

Tarefa

Find the price of the most expensive song.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 2. Capítulo 1
toggle bottom row

SQL Min and Max

Aggregate Functions

There are functions in SQL that returns single line result among a group of the rows. These functions are called aggregate functions.

MIN() and MAX() functions return the minimum and maximum result from the query, and this is always a single line.

Let's find the release date of the oldest song in our table:

1
SELECT MIN(year) FROM songs
copy

Now, let's select the price of the most expensive song of 21st century:

12
SELECT MAX(price) FROM songs WHERE year > 2000
copy

Tarefa

Find the price of the most expensive song.

Tarefa

Find the price of the most expensive song.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 2. Capítulo 1
toggle bottom row

SQL Min and Max

Aggregate Functions

There are functions in SQL that returns single line result among a group of the rows. These functions are called aggregate functions.

MIN() and MAX() functions return the minimum and maximum result from the query, and this is always a single line.

Let's find the release date of the oldest song in our table:

1
SELECT MIN(year) FROM songs
copy

Now, let's select the price of the most expensive song of 21st century:

12
SELECT MAX(price) FROM songs WHERE year > 2000
copy

Tarefa

Find the price of the most expensive song.

Tarefa

Find the price of the most expensive song.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Aggregate Functions

There are functions in SQL that returns single line result among a group of the rows. These functions are called aggregate functions.

MIN() and MAX() functions return the minimum and maximum result from the query, and this is always a single line.

Let's find the release date of the oldest song in our table:

1
SELECT MIN(year) FROM songs
copy

Now, let's select the price of the most expensive song of 21st century:

12
SELECT MAX(price) FROM songs WHERE year > 2000
copy

Tarefa

Find the price of the most expensive song.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 2. Capítulo 1
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt