Instructions:
Find the percentage of flights from Delta by origin (carrier = 'DL')
In the query, alias the column as
percentage_flight_distance_from_delta
Sample Solution:
SELECT origin,
100.0*(sum(CASE WHEN carrier = 'DL' THEN distance ELSE 0 END)/sum(distance)) as percentage_flight_distance_from_delta FROM flights
GROUP BY origin;
No comments:
Post a Comment