Forum Moderators: coopster
I am working on a travel specials management system. The 'specials' table in the db has a resort_id fk to the 'resorts' table to identify what resort the special applies to. The resort entry in the 'resorts' table has fields for room categories - room_cat_1, room_cat_2, etc. I need to have a field in the 'specials' table that identifies what room categories that the special applies to at the particular resort.
One idea I had was to have a field in the 'specials' table that just contained integers for the room categories, so room_cat_1 would be entered into the specials table as 1, so if the special applied to room_cat_1, room_cat_3, and room_cat_5 the entry in the room_cats field in the 'specials table' would be '135'.
So my question is, when I retrieve the data, what kind of syntax would I use to explode the integer string and convert it to the field correct field names in the 'resorts' table?
Is my approach reasonable? Is what I really need another table called 'room_cats' that contains a resort_id fk and a row for each room cat? I know that is what the rules of normalization call for, but there will be about 40 resorts and a max of 8 room cats for each resort so it seems that fully normalizing would actually create more records....
Thanks,
Mark
Normalization just makes things so much easier down the road and it is so easy to structure now as opposed to redesigning later.