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,
12345SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
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.
Swipe to start coding
From the audi_cars
table extract the information for the cheapest car with Semi-Auto transmission.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Awesome!
Completion rate improved to 2.63Awesome!
Completion rate improved to 2.63
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,
12345SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
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.
Swipe to start coding
From the audi_cars
table extract the information for the cheapest car with Semi-Auto transmission.
Løsning
Takk for tilbakemeldingene dine!
single
Awesome!
Completion rate improved to 2.63
The cheapest car
Sveip for å vise menyen
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,
12345SELECT * FROM audi_cars WHERE fueltype = 'Diesel' ORDER BY price DESC LIMIT 1
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.
Swipe to start coding
From the audi_cars
table extract the information for the cheapest car with Semi-Auto transmission.
Løsning
Takk for tilbakemeldingene dine!