Last post Mar 23, 2012 12:17 PM by paritoshmmec
Mar 20, 2012 03:07 PM|johnjohn123123|LINK
i am working on a hotel reservation system using asp.net MVC 3 and i have the following tables:-
1. Customer table that have:-
2. Room table
for the reservation i have two approaches either by having
Having PK (Room_number & Customer_Id & Date) since that same room cannot be reserved by the same customer at the same day.
OR i can build the reservation table as following; by adding a reservation ID to my Reservation table instead of having the PK consists of three columns which will ease the code for retrieving , updating the reservation object, as follow:-
i found that introducing a reservation ID will simplify the code and might have better performance advantages because it will make it faster to retrieve and update the reservation records,, but introducing the reservation_ID will break the 3rd normal form.
So should i break the 3rd normal form to gain the simplicity and performance advantages.
Mar 20, 2012 03:38 PM|TabAlleman|LINK
Simplifying code and improving performance are both good enough reasons to break 3NF. I would do it.
Mar 23, 2012 12:17 PM|paritoshmmec|LINK
1. If your Reservation table grow large over the time what you can do is create xml columns in Room table and contain here the xml of userdetails
2. creation of Reservation table is also a good option (consider partitioning )