Hi there - I’m having a hard time understanding the code presented to me vs. the code I wrote on my own to answer the question.
Code this: How many flights are there on average for all Fridays in a given month
AVG (count_friday_flights) AS avg_fri_flights
COUNT (*) AS count_friday_flights
WHERE dep_day_of_week = ‘Friday’
GROUP BY dep_month)
group by dep_month;
AVG(a.flight_count) AS average_flights
COUNT(*) AS flight_count
GROUP BY 1,2,3
GROUP BY 1,2
ORDER BY 1,2;
I think my code is a little simpler - but am I breaking any rules? Why would I use the other code? Am I missing something?