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

bookSQL 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.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

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

bookSQL 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.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

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

bookSQL 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.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

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.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 2. Capítulo 1
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
some-alt