Which builder has the least trains?
select t1.builder from railway as t1 join train as t2 on t1.railway_id = t2.railway_id group by t2.railway_id order by count ( * ) asc limit 1
How about the builder with the most trains?
select t1.builder from railway as t1 join train as t2 on t1.railway_id = t2.railway_id group by t2.railway_id order by count ( * ) desc limit 1
What is his id?
select t1.railway_id from railway as t1 join train as t2 on t1.railway_id = t2.railway_id group by t2.railway_id order by count ( * ) desc limit 1