[Not: the user asks again in the Development of the railway request system, how to simulate trains, stations and stops? ] Description of my problem:
Suppose I have BUS-123 in ROUTE-1 , it will go through A, B, C, D, E, F, G, H and BUS-321 in ROUTE-2 through D, E, F, X, Y, Z. if someone enters B as the starting point and F as the destination, then ROUTE-1 with BUS-123 should be displayed as a result. But if someone enters H as the source, and A as the result of the assignment should not be displayed, because the return may not always match the one that was sent. But if a person enters A as a source and Z as a destination, then BUS-123 with ROUTE-1 and BUS-321 with ROUTE-2 .
My problem: How to save route information in a database? if I store in an RDBMS as shown below:
BUS_NUMBER ROUTE_NUMBER VIA_ROUTES BUS-123 ROUTE-1 A, B, C, D, E, F, G, H BUS-321 ROUTE-2 D, E, F, X, Y, Z
Whereas my search will work. I mean, how to look for it in a string. And if I store all VIA_ROUTES in different columns, then how will it be ..? Please offer me your technique. This is not urgent, but I plan to do a basic search for the bus route, so your comment using has been appreciated.