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

Зміст курсу

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

Завдання

Find the price of the most expensive song.

Завдання

Find the price of the most expensive song.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 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

Завдання

Find the price of the most expensive song.

Завдання

Find the price of the most expensive song.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 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

Завдання

Find the price of the most expensive song.

Завдання

Find the price of the most expensive song.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

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

Завдання

Find the price of the most expensive song.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 1
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt