Question
Write a nested SQL query that returns the top 10 electric vehicles (make, model, year) by average electric range. The average electric range should be
Write a nested SQL query that returns the top 10 electric vehicles (make, model, year) by average electric range. The average electric range should be computed from the electric range numbers reported in the ev_wa table. The reason this is a nested query is because each VIN (vehicle identification number) may be included multiple times in the table, so you will first need to compute the average range per car (per VIN) before aggregating over make-model-year. In your final output table, please include the model_year, make, model, number of cars of that make-model-year, and the average electric range. Hint: you might want to start by writing a query computing the average electric range for each VIN.
id vin county city state postal_code model_year make model ev_type cafv_eligibility electric_range base_msrp census_tractStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started