✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.
Attempt all questions first.
✔️ Click SUBMIT at the end to unlock VIEW ANSWER buttons.
This SQL quiz uses real automobile data including mileage, speed, and Global/Euro NCAP safety ratings to help you master advanced SQL queries used in real-world database scenarios.
The table given below shows popular car brands and their variants. Each car is listed along with its best-known feature, mileage, top speed, and an indicative international safety rating (based on widely reported Global/Euro NCAP crash test results).
| car_id | brand | model | best_feature | mileage_kmpl | top_speed_kmph |
|---|---|---|---|---|---|
| 1 | Toyota | Corolla | Mileage | 22 | 180 |
| 2 | Honda | City | Comfort | 18 | 190 |
| 3 | BMW | M3 | Speed | 12 | 280 |
| 4 | Hyundai | Verna | Mileage | 21 | 185 |
| 5 | Mercedes | C-Class | Comfort | 14 | 240 |
| car_id | ncap_agency | safety_rating_stars | airbags |
|---|---|---|---|
| 1 | Global NCAP | 5 | 7 |
| 2 | Global NCAP | 4 | 6 |
| 3 | Euro NCAP | 5 | 8 |
| 4 | Global NCAP | 5 | 6 |
| 5 | Euro NCAP | 5 | 7 |
About the Cars Used in This SQL Quiz
This SQL quiz is built using real-world automobile models such as Toyota Corolla, Honda City, BMW M3, Hyundai Verna, and Mercedes-Benz C-Class. These cars are widely compared based on fuel mileage, top speed, driving comfort, and Global / Euro NCAP safety ratings.
Such specifications are commonly used in car reviews, sedan comparisons, and automobile buying guides.
Queries involve CAR_SPECS table.
📌 The highest mileage car is Toyota Corolla, with a mileage of 22 kmpl.
📌 The fastest cars per best feature are Toyota Corolla (Mileage), Mercedes C-Class (Comfort), and BMW M3 (Speed).
📌 Based on top speed, BMW M3 ranks highest, followed by Mercedes C-Class and Honda City.
📌 The top-speed cars per feature are Toyota Corolla (Mileage), Mercedes C-Class (Comfort), and BMW M3 (Speed).
Queries involve both CAR_SPECS and CAR_SAFETY tables.
📌 The 5-star safety rated cars are Toyota Corolla, BMW M3, Hyundai Verna, and Mercedes C-Class.
📌 Among cars with a 5-star safety rating, Toyota Corolla offers the highest mileage.
📌 For each best feature category, the query retrieves the car(s) with the highest safety rating, which is 5 stars.
📌 Based on the given data, the highest safety-rated cars per feature are:
- Mileage: Toyota Corolla, Hyundai Verna (5★)
- Comfort: Mercedes C-Class (5★)
- Speed: BMW M3 (5★)
📌 Cars with 5-star safety ratings rank highest, whereas Honda City ranks lower due to its 4-star rating.
📌 The safest cars within each feature category are Toyota Corolla (Mileage), Mercedes C-Class (Comfort), and BMW M3 (Speed).
Real-World Automobile Data Use Case
Automobile companies and car review platforms often store vehicle specifications such as fuel efficiency, engine performance, top speed, and safety ratings in relational databases. SQL queries like those used in this quiz help analysts generate car comparison reports, identify best mileage cars, and rank safest sedans for customers.
No comments:
Post a Comment