human
Schema:
routes (rid, dst_apid, dst_ap, src_apid, src_ap, alid, airline, codeshare)
airports (apid, name, city, country, x, y, elevation, iata, icao)
airlines (alid, name, iata, icao, callsign, country, active)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of airport which is the source for the most number of flight routes?
assistant
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT( * ) DESC LIMIT 1;
human
What are the names of city of airport which is the source for the most number of flight routes | Do you mean the name of city which is the source for the most number of flight routes? | Yes
assistant
SELECT T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT( * ) DESC LIMIT 1 ;