You're given a table with information on the car trips made by publishing house employees:
CREATE TABLE company_car_trip (
id integer PRIMARY KEY,
country varchar(64),
car_size varchar(8),
distance decimal(6, 2),
fuel_consumed decimal(5, 2)
);
Your task is to create a view showing the average fuel consumption per each combination of country and car size.
Create a view named car_trip_stats with the following columns:
country
car_size
avg_fuel_per_100 – the average fuel consumed, divided by the distance driven and then multiplied by 100.
Only consider those country-car_size combinations that have at least two trips.