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

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

Task

Find the price of the most expensive song.

Task

Find the price of the most expensive song.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 2. Chapter 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

Task

Find the price of the most expensive song.

Task

Find the price of the most expensive song.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 2. Chapter 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

Task

Find the price of the most expensive song.

Task

Find the price of the most expensive song.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

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

Task

Find the price of the most expensive song.

Switch to desktop for real-world practiceContinue from where you are using one of the options below
Section 2. Chapter 1
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt