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
Find the station id of Ananthapuri Express? | the station ids that serve the train Ananthapuri Express are 1 and 2 | What are the annual entry exit of station id 1?
assistant
SELECT Annual_entry_exit FROM station WHERE station_id = '1';
human
Find the total passengers of station id 1 and 2?
assistant
SELECT Total_Passengers FROM station WHERE station_id = '1' OR station_id = '2';
human
What are the names of the stations which serve both 'Ananthapuri Express' and 'Guruvayur Express' train?
assistant
SELECT T2.name 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 T3.Name = "Ananthapuri Express" INTERSECT SELECT T2.name 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 T3.Name = "Guruvayur Express" ;