0

hi;

here is a part of my ERD "Hotel Reservation system"
and there is a relationship with 3 entities included in it.

they are:
customer
Reservation
Room

the relationship between them is "assign to"

I make it as 1 to 1 relationship

and i want to know than , how to make normalization for it?

take the pk of one of them to the other remaining entity
and thats it !

or what ?

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by Zay
0

Assuming you do want a 1-to-1 relationship between each entity, then you just need to have one entity with a primary key and the others to have foreign keys to the primary key. If that is your normalized form, then a person can book only one room and one room can only be booked by one person. Even after the person checks out, noone else can book the room and that person can never book another room.

What you probably want is a 1-to-1 relationship between those tables. If you had a 1-to-1 relationship, once a room is booked, it can never be booked again. What you want is a 1-to-many relationship from customer to reservation and a 1-to-many relationship from room to reservation.

0

Assuming you do want a 1-to-1 relationship between each entity, then you just need to have one entity with a primary key and the others to have foreign keys to the primary key. If that is your normalized form, then a person can book only one room and one room can only be booked by one person. Even after the person checks out, noone else can book the room and that person can never book another room.

What you probably want is a 1-to-1 relationship between those tables. If you had a 1-to-1 relationship, once a room is booked, it can never be booked again. What you want is a 1-to-many relationship from customer to reservation and a 1-to-many relationship from room to reservation.

i got your point , thanks alot
and I did it , but the real Q was the other relation showing in the following ERD
which is "assign to "
is it correct to be 1-to-1 relationship ?

Attachments ERD.GIF 3.33 KB
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.