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
how many countries have airlines?
assistant
SELECT COUNT( distinct country ) FROM airlines;
human
how many airlines does each country have?
assistant
SELECT COUNT( * ) , country FROM airlines GROUP BY country;
human
show the one that has the most.
assistant
SELECT country FROM airlines GROUP BY country ORDER BY COUNT( * ) DESC LIMIT 1 ;