human
Schema:
flight (flno, origin, destination, distance, departure_date, arrival_date, price, aid)
aircraft (aid, name, distance)
employee (eid, name, salary)
certificate (eid, aid)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the origin for all flights.
assistant
SELECT origin FROM Flight;
human
For each city, how many flights are departing from there?
assistant
SELECT origin , COUNT( * ) FROM Flight GROUP BY origin;
human
Order them in descending order of number of departures.
assistant
SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT( * ) DESC;
human
Which origin has the most?
assistant
SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT( * ) DESC LIMIT 1 ;