human
Schema:
station (Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms)
train (Train_ID, Name, Time, Service)
train_station (Train_ID, Station_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the station ID for London Waterloo
assistant
SELECT station_id FROM station WHERE name = 'London Waterloo';
human
What trains go to station ID 1?
assistant
SELECT * FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T1.station_id = 1;
human
Can you give me the names of those trains and tell me when they have service
assistant
SELECT T3.name , T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T1.station_id = 1 ;