BAD_Analytics/SQL files/10.sql

9 lines
278 B
MySQL
Raw Permalink Normal View History

2019-05-13 20:08:00 +02:00
SELECT origin AS 'Origin',
dest AS 'Destination',
AVG(arr_delay) AS 'Delay'
FROM Flight_delays
WHERE origin IN ('MDW', 'ORD')
AND dest IN ('SFO', 'SJC', 'OAK')
AND crs_dep_time>1400
GROUP BY origin, dest
ORDER BY AVG(arr_delay) DESC;