Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2010
    Posts
    4

    Lightbulb Unanswered: Need Help in Databse design for "Bus Route System"

    Hi Everyone,

    I wanted to design a "Bus route System" database schema for a city like bangalore or any other metro city........


    My basic requirements are:

    1. I want to store bus information
    2. if the user gives the SOURCE and DESTINATION name, the list of routes should be provided to user as a output
    3. user should be informed with the bus nos also......

    Please, help me to create tables and establishing the relationship between tables for my Bus Route System Database

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what do you have so far?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2010
    Posts
    4

    Lightbulb

    Hi
    Thanks for replying,


    Actually I'm at beginning stage now , i have just thought of two tables:

    1.Bus(bus_no)

    2.BusRoutes(route_id, route_name,bus_no)


    But i'm not sure whether i thought rite or wrong........one more thing is in the above BusRoutes table route_name will contain multiple stations........for example...input data for BusRoutes is....

    route_id:1
    route_name:"Source-stop1-stop2-stop3-stop4-Destination"
    bus_no:180A

    route_id:1A
    route_name:"Source-stop1-stop2-stop3-stop4-stop5-Destination"
    bus_no:180B

    Is it correct to store the complete route as a lengthy string in my DataBase ?
    How much is correct in whatever i thought till now.....?
    Please guide me....

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Sunilbabucs50 View Post
    Is it correct to store the complete route as a lengthy string in my DataBase ?
    no, it isn't

    you'll need another table for the stops for each route
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Sep 2010
    Posts
    4

    Lightbulb

    OK....so i need to have one more table,here i'm having all my three tables..........required for my database.

    1.Bus(bus_no)

    2.BusRoutes(route_id,bus_no)

    3.BusStops(stop_id,Stop_name)

    I'm confused with third table' data.......if i'm going to store only stop names...how to retrieve a route for the given source and destination...?

    whatever the columns i thought for the above tables are correct or any modification is required....?

    only these three tables r enough to full fill my requirement......i mean if user gives source and destination...he should be informed with diff routes available......and the busno for that route........for this requirement any extra tables are required?

    How to establish the relationship between the above tables...?

    Please reply....your help is very valuable for me.....
    Last edited by Sunilbabucs50; 09-13-10 at 03:18.

  6. #6
    Join Date
    Sep 2010
    Posts
    4

    Question need help to design Bus route System database

    Hi Everyone,

    I wanted to design a "Bus route System" database schema for a city like bangalore or any other metro city........


    My basic requirements are:

    1. I want to store bus information
    2. if the user gives the SOURCE and DESTINATION name, the list of routes should be provided to user as a output
    3. user should be informed with the bus nos also......

    Please, help me to create tables and establishing the relationship between tables for my Bus Route System Database

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •