Most efficient non-plug-in cars of 2024
Intermediatefiltering + ORDER BYVehicle fuel economy (FuelEconomy.gov, model years 2010–2027)
Among model year 2024 records whose atv_type is blank or Hybrid, return the top 5 by comb_mpg: make, model, comb_mpg. Break ties by make, then model (A→Z).
Solution
SELECT make, model, comb_mpg
FROM vehicles
WHERE year = 2024 AND atv_type IN ('', 'Hybrid')
ORDER BY comb_mpg DESC, make, model
LIMIT 5;Expected output:
Hint
atv_type IN ('', 'Hybrid'). Sort on three keys.
Same question in Excel / Google Sheets
Filter year = 2024 and atv_type (Blanks)/Hybrid, then sort by comb_mpg Z→A, make A→Z, model A→Z.
Download the CSV from the datasets page. Column letters assume the CSV opens with its header in row 1.
Tip: Ctrl+Enter (⌘+Enter on Mac) checks your answer. Everything runs in your browser; nothing you type is sent anywhere.