Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
MINimal and MAXimal values | Aggregating
SQL Basics
course content

Зміст курсу

SQL Basics

SQL Basics

1. Selecting
2. Filtering
3. Aggregating
4. Sorting
5. Grouping
6. Practicing

MINimal and MAXimal values

Now it's time to talk about aggregate functions - functions that calculate some summary stats. Let's start with extremal summary stats - minimum and maximum values.

To find the minimum (or maximum) value in the column use MIN (or MAX) functions followed by column name. For example, we can find out the cheapest car with Automatic transmission.

123
SELECT MIN(price) FROM audi_cars WHERE transmission = 'Automatic'
copy

Please note, that unlike for DISTINCT function you need to use parentheses for MIN and MAX functions.

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

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

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

Секція 3. Розділ 1
toggle bottom row

MINimal and MAXimal values

Now it's time to talk about aggregate functions - functions that calculate some summary stats. Let's start with extremal summary stats - minimum and maximum values.

To find the minimum (or maximum) value in the column use MIN (or MAX) functions followed by column name. For example, we can find out the cheapest car with Automatic transmission.

123
SELECT MIN(price) FROM audi_cars WHERE transmission = 'Automatic'
copy

Please note, that unlike for DISTINCT function you need to use parentheses for MIN and MAX functions.

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

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

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

Секція 3. Розділ 1
toggle bottom row

MINimal and MAXimal values

Now it's time to talk about aggregate functions - functions that calculate some summary stats. Let's start with extremal summary stats - minimum and maximum values.

To find the minimum (or maximum) value in the column use MIN (or MAX) functions followed by column name. For example, we can find out the cheapest car with Automatic transmission.

123
SELECT MIN(price) FROM audi_cars WHERE transmission = 'Automatic'
copy

Please note, that unlike for DISTINCT function you need to use parentheses for MIN and MAX functions.

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

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

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

Now it's time to talk about aggregate functions - functions that calculate some summary stats. Let's start with extremal summary stats - minimum and maximum values.

To find the minimum (or maximum) value in the column use MIN (or MAX) functions followed by column name. For example, we can find out the cheapest car with Automatic transmission.

123
SELECT MIN(price) FROM audi_cars WHERE transmission = 'Automatic'
copy

Please note, that unlike for DISTINCT function you need to use parentheses for MIN and MAX functions.

Завдання

From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).

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