how 2 make normalization 4 this relationship?

Reply

Join Date: Apr 2007
Posts: 85
Reputation: Zay is an unknown quantity at this point 
Solved Threads: 0
Zay's Avatar
Zay Zay is offline Offline
Junior Poster in Training

how 2 make normalization 4 this relationship?

 
0
  #1
Dec 9th, 2008
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 ?
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: how 2 make normalization 4 this relationship?

 
0
  #2
Dec 9th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 85
Reputation: Zay is an unknown quantity at this point 
Solved Threads: 0
Zay's Avatar
Zay Zay is offline Offline
Junior Poster in Training

Re: how 2 make normalization 4 this relationship?

 
0
  #3
Dec 9th, 2008
Originally Posted by timothybard View Post
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 ?
Attached Thumbnails
ERD.GIF  
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC