human
Schema:
train (id, train_number, name, origin, destination, time, interval)
station (id, network_name, services, local_authority)
route (train_id, station_id)
weekly_weather (station_id, day_of_week, high_temperature, low_temperature, precipitation, wind_speed_mph)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the origins of all trains?
assistant
SELECT origin FROM train ;
human
Which origin has the most number of trains?
assistant
SELECT origin FROM train GROUP BY origin ORDER BY COUNT( * ) DESC LIMIT 1 ;
human
Find the number of trains starting from each origin.
assistant
SELECT origin , COUNT( * ) FROM train GROUP BY origin ;