for the transportation system .

A Master Table stores the Stop Name as PK (Stop Master)
Another Master Table stores the Line Name as PK ( Line Master)
The Third Master Table stores the The Relation of Stop and Line
(Line_Detail) . PK is Line Name , Stop Name , Sequence of the Stop in this line .
For Example , StopA , StopB , StopC forms Line1

The Data looks like

Line1 StopA 1 (first stop)
Line1 StopB 2 (second stop)
Line1 StopC 3 (third stop)

now after implementing all the data in the third tables .
how to write a query to fetch all the possible routine from
one Stop to another Stop ?

It is really headache .