human
Schema:
railway (Railway_ID, Railway, Builder, Built, Wheels, Location, ObjectNumber)
train (Train_ID, Train_Num, Name, From, Arrival, Railway_ID)
manager (Manager_ID, Name, Country, Working_year_starts, Age, Level)
railway_manage (Railway_ID, Manager_ID, From_Year)
Please answer with SQL.
assistant
Sure, I understand.
human
List all the locations.
assistant
SELECT LOCATION FROM railway;
human
Which ones have more than one railways?
assistant
SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT( * ) > 1;
human
Show the locations and the corresponding counts of each.
assistant
SELECT LOCATION , COUNT( * ) FROM railway GROUP BY LOCATION ;