Non correlated subqueries
Can some one please help me understand the purpose of sub queries in this example and what each precise piece of code is doing in this query by explaining what each line of the code is doing? id be really grateful
-Why and how is the table now named a?
-what is happening with the GROUP BY 1,2,3 -where did 123 come from what do they represent?
-also could this be done without a sub query? just using AVG()?
AVG(a.flight_count) AS average_flights
COUNT(*) AS flight_count
GROUP BY 1,2,3
GROUP BY 1,2
ORDER BY 1,2;