Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Proper databse for a seatmap/multiple?

Proper databse for a seatmap/multiple?

Scheduled Pinned Locked Moved Database
databasehelptutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yhen Caisip
    wrote on last edited by
    #1

    Hello i am Rodney and i have a problem on how should i arrange the seatmap database. i have id, busNumber, from, to, seatId, column, reserveStatus, firstname,lastName, paid, tripStatus(finish/not). i have made this working but the thing that im talking about multiple reservation from Point A to Point E, then there is substation of B,C, and D. What i have in mind is assuming there are 3 stopovers, should i just add columns in my seatMap table, like (stop1 = stopover1) stop1Firstname,stop1LastName,stop1ReserveStatus,stop1Paid,stop1TripStatus. Thats what i have in mind but is there any better way solving these? or should i make new tables for stopover1 stopover stopover3 if it is so could u please guide me, i mean i dont have that much of an idea regarding to that. Thanks a lot. Sorry for my english.

    P J 2 Replies Last reply
    0
    • Y Yhen Caisip

      Hello i am Rodney and i have a problem on how should i arrange the seatmap database. i have id, busNumber, from, to, seatId, column, reserveStatus, firstname,lastName, paid, tripStatus(finish/not). i have made this working but the thing that im talking about multiple reservation from Point A to Point E, then there is substation of B,C, and D. What i have in mind is assuming there are 3 stopovers, should i just add columns in my seatMap table, like (stop1 = stopover1) stop1Firstname,stop1LastName,stop1ReserveStatus,stop1Paid,stop1TripStatus. Thats what i have in mind but is there any better way solving these? or should i make new tables for stopover1 stopover stopover3 if it is so could u please guide me, i mean i dont have that much of an idea regarding to that. Thanks a lot. Sorry for my english.

      P Offline
      P Offline
      Peter Leow
      wrote on last edited by
      #2

      This is not going to work. In order to do it right, I suggest you read this : 11 important database designing rules which I follow[^]

      Y 1 Reply Last reply
      0
      • P Peter Leow

        This is not going to work. In order to do it right, I suggest you read this : 11 important database designing rules which I follow[^]

        Y Offline
        Y Offline
        Yhen Caisip
        wrote on last edited by
        #3

        hello, thanks a lot. anyway, so it is much better to make new tables per stopovers right? for example buses have stopovers i.e PointA - Point D, which means it has stopover of Stopover B and Stopover C. In my mind is that a table for the origin and destination, reservation (id,busNum,reserveStatus,seatId,seatColuumn,fullName,date) and for the stopovers(id,busNum,date,stopoverName,seatId,seatColumn,reserveStatus,fullName). Could you please guide me for a better way or if this would do? Thanks a lot

        P 1 Reply Last reply
        0
        • Y Yhen Caisip

          Hello i am Rodney and i have a problem on how should i arrange the seatmap database. i have id, busNumber, from, to, seatId, column, reserveStatus, firstname,lastName, paid, tripStatus(finish/not). i have made this working but the thing that im talking about multiple reservation from Point A to Point E, then there is substation of B,C, and D. What i have in mind is assuming there are 3 stopovers, should i just add columns in my seatMap table, like (stop1 = stopover1) stop1Firstname,stop1LastName,stop1ReserveStatus,stop1Paid,stop1TripStatus. Thats what i have in mind but is there any better way solving these? or should i make new tables for stopover1 stopover stopover3 if it is so could u please guide me, i mean i dont have that much of an idea regarding to that. Thanks a lot. Sorry for my english.

          J Offline
          J Offline
          Jorgen Andersson
          wrote on last edited by
          #4

          Have a look at this[^] schema. It's for an Airline, but I believe you can reuse most of the info.

          Wrong is evil and must be defeated. - Jeff Ello[^]

          1 Reply Last reply
          0
          • Y Yhen Caisip

            hello, thanks a lot. anyway, so it is much better to make new tables per stopovers right? for example buses have stopovers i.e PointA - Point D, which means it has stopover of Stopover B and Stopover C. In my mind is that a table for the origin and destination, reservation (id,busNum,reserveStatus,seatId,seatColuumn,fullName,date) and for the stopovers(id,busNum,date,stopoverName,seatId,seatColumn,reserveStatus,fullName). Could you please guide me for a better way or if this would do? Thanks a lot

            P Offline
            P Offline
            Peter Leow
            wrote on last edited by
            #5

            To be able to design a database correctly, one has to understand the users' requirements and their business rules. Many considerations arise, such as: 1. Can a passenger start and end his journey at any stopovers? 2. How to ensure a seat in a bus is not reserved by more than one passengers for a journey on the same date and time. Based on the limited info that you have given and my own assumption, I have drafted a preliminary database schema for your reference and adaptation, you will have to work out your final solution yourself:

            Table: reservation
            reserveID (PRIMARY KEY),
            busID,
            reserveStatus,
            custID (Foreign Key to custID in customer table),
            start_stopoverID,
            end_stopoverID,
            [other fields]

            Table: customer
            custID (PRIMARY KEY),
            custName,
            [other fields]

            Table: bus
            busID (PRIMARY KEY),
            busNum,
            [other fields]

            Table: stopovers
            stopoverID (PRIMARY KEY),
            stopoverName,
            [other fields]

            Table: bus_stopovers
            stopoverID (PRIMARY KEY),
            busID (PRIMARY KEY),
            [other fields]

            Y 1 Reply Last reply
            0
            • P Peter Leow

              To be able to design a database correctly, one has to understand the users' requirements and their business rules. Many considerations arise, such as: 1. Can a passenger start and end his journey at any stopovers? 2. How to ensure a seat in a bus is not reserved by more than one passengers for a journey on the same date and time. Based on the limited info that you have given and my own assumption, I have drafted a preliminary database schema for your reference and adaptation, you will have to work out your final solution yourself:

              Table: reservation
              reserveID (PRIMARY KEY),
              busID,
              reserveStatus,
              custID (Foreign Key to custID in customer table),
              start_stopoverID,
              end_stopoverID,
              [other fields]

              Table: customer
              custID (PRIMARY KEY),
              custName,
              [other fields]

              Table: bus
              busID (PRIMARY KEY),
              busNum,
              [other fields]

              Table: stopovers
              stopoverID (PRIMARY KEY),
              stopoverName,
              [other fields]

              Table: bus_stopovers
              stopoverID (PRIMARY KEY),
              busID (PRIMARY KEY),
              [other fields]

              Y Offline
              Y Offline
              Yhen Caisip
              wrote on last edited by
              #6

              Thank you so much for the draft. I will work for it. i hope i could do these multiple seatmap. i need it do be done soon. Thanks a bunch.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups