| | |
how 2 make normalization 4 this relationship?
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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 ?
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 ?
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.
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.
•
•
•
•
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.
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 ?
![]() |
Similar Threads
- Database Design and normalization new requirements? (Database Design)
Other Threads in the Database Design Forum
- Previous Thread: Entity Relationship Diagram for a library-HELP NEEDED
- Next Thread: Questions on connection pooling and concurrent transactions
| Thread Tools | Search this Thread |





