Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
The cheapest car | Sorting
SQL Basics
course content

Contenido del Curso

SQL Basics

SQL Basics

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

The cheapest car

Remember the task from the third section, where you calculated the maximum price of a Diesel car? What if we want to see not only the price, but also what model, mileage, and other characteristics of this car?

One of the ways to solve it - is using nested queries, but this is not the topic for this course. Easier, you can order your table in descending order and limit the number of rows to 1! For example,

12345
SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
copy

This query will return all the Diesel cars, ordered by price in descending order with only 1 row! This is the car we were looking for.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 4. Capítulo 3
toggle bottom row

The cheapest car

Remember the task from the third section, where you calculated the maximum price of a Diesel car? What if we want to see not only the price, but also what model, mileage, and other characteristics of this car?

One of the ways to solve it - is using nested queries, but this is not the topic for this course. Easier, you can order your table in descending order and limit the number of rows to 1! For example,

12345
SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
copy

This query will return all the Diesel cars, ordered by price in descending order with only 1 row! This is the car we were looking for.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 4. Capítulo 3
toggle bottom row

The cheapest car

Remember the task from the third section, where you calculated the maximum price of a Diesel car? What if we want to see not only the price, but also what model, mileage, and other characteristics of this car?

One of the ways to solve it - is using nested queries, but this is not the topic for this course. Easier, you can order your table in descending order and limit the number of rows to 1! For example,

12345
SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
copy

This query will return all the Diesel cars, ordered by price in descending order with only 1 row! This is the car we were looking for.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Remember the task from the third section, where you calculated the maximum price of a Diesel car? What if we want to see not only the price, but also what model, mileage, and other characteristics of this car?

One of the ways to solve it - is using nested queries, but this is not the topic for this course. Easier, you can order your table in descending order and limit the number of rows to 1! For example,

12345
SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
copy

This query will return all the Diesel cars, ordered by price in descending order with only 1 row! This is the car we were looking for.

Tarea

From the audi_cars table extract the information for the cheapest car with Semi-Auto transmission.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 4. Capítulo 3
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt