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 is the name of the airport in Mount Hagen city?
assistant
SELECT name FROM airports WHERE city = 'Mount Hagen';
human
Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'?
assistant
SELECT COUNT( * ) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines';
human
How many active airlines are on the list?
assistant
SELECT COUNT( * ) FROM airlines WHERE active = 'Y';
human
What is the elevation of Madang Airport airport?
assistant
SELECT elevation FROM airports WHERE name = "Madang Airport" ;