Question: Write a SQL with inline view to find the number of vehicles with the same number of cylinders for vehicles built in 1985 for cylinders

Write a SQL with inline view to find the number of vehicles with the same number of cylinders for vehicles built in 1985 for cylinders from 1 to 16.
Hint:
8.1 Use column n in numbers table from 1 to 16 as the number of cylinders.
8.2 In the INLINE VIEW, use GROUP BY on column cylinders (in vehicle table) to calculate number of vehicles with the same number of cylinders.
8.3 If the number of vehicle is null, then use a case statement to replace null value with 0.
8.4 Use either LEFT JOIN (or RIGHT JOIN).
8.5 Use numbers table, vehicle table, case statement, and inline view.
Paste the SQL below.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
