-
-
Save codecademydev/b99936ea23c720b14b4aa24c7d5581c3 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.dep_month, | |
a.dep_day_of_week, | |
AVG(a.flight_distance) AS average_distance | |
FROM ( | |
SELECT dep_month, | |
dep_day_of_week, | |
dep_date, | |
sum(distance) AS flight_distance | |
FROM flights | |
GROUP BY 1,2,3 | |
) a | |
GROUP BY 1,2 | |
ORDER BY 1,2; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment