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
show all cities that have an airport.
assistant
SELECT city FROM airports;
human
which of them are in the United States?
assistant
SELECT city FROM airports WHERE country = 'United States';
human
just show cities that have more than 2 airports.
assistant
SELECT city FROM airports WHERE country = "United States" GROUP BY city HAVING COUNT( * ) > 2 ;