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

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_tract

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!