Unable to create a better database structure

Rohitashv Singhal

I want to create a basic project to search buses from one station to another

Let I have four stations A,B,C,D and I have four buses 1,2,3,4

Root of buses are

bus 1 : A->B->C->D
Bus 2 : A->C->D
Bus 3 : A->C->B
Bus 4 : A->B->D

How can I design a database for such system

I have tried

Method 1: I have created a table with two fields busno and busroute in bus route I want to store complete route of the bus number. but I think searching in this table will be very complex

or please suggest me a better Idea for such project

cske

My hint is, 3 tables

Bus

  • id
  • name

Stops

  • id
  • name

Route

  • BusId
  • StopId
  • position

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related