0

I have a reservation table

enter image description here

and a Preference table

enter image description here

And now i have a dropdownlist from wich i chose a preference when i am making a reservation.what i want to do is to use checkbox when i am making reservation so that i can select more preferences.Is this posibile ?how can i save two preferences in same reservation table.

jonny
  • 797
  • 4
  • 24
  • 41

2 Answers2

1

You can't if you want your tables to stay normalized.

What you would want to do is make another table called Reservation_Preferences and have it be made up of ReservationID, PreferenceID, and I guess Preference_Quantity. The 2 IDs would be your PK for the table, and each ID column would have a FK relationship to their respective parent table. Remove the 2 Preference columns from the Reservation table, and you would have yourself a nice normalized schema.

Jason
  • 1,325
  • 6
  • 14
0

You'd have to create a linking table with two columns: ReservationID and Preference_Id (possibly Preference_Quantity as well). ReservationID and Preference_Id would constitute the unique key for the table. This table would have FK constraints to the two original tables.

You'd have to remove Preference_Id and Preference_Quantity from the reservation table

ssis_ssiSucks
  • 1,476
  • 1
  • 12
  • 11