Show id and location of railways that are associated with more than one train.
create table railway (location varchar, railway_id varchar, PRIMARY KEY (location)); create table train (railway_id varchar, PRIMARY KEY (railway_id))
select t2.railway_id, t1.location from railway as t1 join train as t2 on t1.railway_id = t2.railway_id group by t2.railway_id having count(*) > 1