Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

What are the essential elements of a summer project report?

Answered: 1 week ago

Question

Why could the Robert Bosch approach make sense to the company?

Answered: 1 week ago