Proper databse for a seatmap/multiple?
-
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.
-
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.
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[^]
-
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[^]
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
-
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.
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[^]
-
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
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] -
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]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.