Reputation: 53
I need have a table with columns -> hotel_id, hotel_name, price_per_night, facilities, preferred
In this columns facilities and preferred may have multiple values.
For example->
facilities can be swimming pool, spa etc.(many diff values can be added with time)
preferred can be couples, family etc.(many diff values can be added with time)
I am pretty new to mysql. I am confused how to design my database and thought of following approaches ->
To have a multiple values in a single column (which is a bad idea)
To create three tables ->
a.first would be hotel_main with columns hotel_id, hotel_name, price_per_night
b.second would be facilities_hotel with hotel_id, hotel_name, facility
c.third would be preferred_hotel with hotel_id, hotel_name, preferred
I would like to have more suggestions on how to design my database.
Upvotes: 0
Views: 138
Reputation: 26474
In general non-1NF designs are bad ideas in transactional processing systems. You run into lots of update/delete integrity problems which are hard to solve and MySQL doesn't give you even the tools to make inserts safe.
Where people use non-1NF designs effectively these usually meet two criteria:
Outside cases where both is true don't even think about breaking 1NF. Even where both are true, that's not enough to decide to go that way.
So go with your second approach
Upvotes: 1