Trivial ques-Resolving a Many-to-Many (m:n) Relationship..why reqd
2 posters
Page 1 of 1
Trivial ques-Resolving a Many-to-Many (m:n) Relationship..why reqd
Hi,
This is a very basic cinfusion which I am having.
I have a scenario where the 2 entities are having many to many relationship,I see that it is must to resolve these relationships.
Example : A Fax number directory Entity 1: Person details,Entity 2: Fax numbers,now here a person can be associated with more than one fax numeber and a fax number can be associated with more than one person.
Model 1)
So the entity as of now looks like
E1 (person_id(pk) ,let's assume this makes it unique...other columns)
E2(fax_num(pk),person_id(fk)...other columns)
It is suggested to have another intersection entity E3 and the new relationships will look like
Model 2)
E1 (person_id(pk) ,let's assume this makes it unique...other columns)
E3 (fax_num(pk)(fk),person_id(pk)(fk))
E2(fax_num(pk)... other columns)
Now my question is what if we keep the Model 1) as it is and just make the person_id in E2 as part of the primary key like E2(fax_num(pk),person_id(pk)(fk)...other columns)...may be I am little confused,but to me it looks fine...anyone please comment and give the answer.
This is a very basic cinfusion which I am having.
I have a scenario where the 2 entities are having many to many relationship,I see that it is must to resolve these relationships.
Example : A Fax number directory Entity 1: Person details,Entity 2: Fax numbers,now here a person can be associated with more than one fax numeber and a fax number can be associated with more than one person.
Model 1)
So the entity as of now looks like
E1 (person_id(pk) ,let's assume this makes it unique...other columns)
E2(fax_num(pk),person_id(fk)...other columns)
It is suggested to have another intersection entity E3 and the new relationships will look like
Model 2)
E1 (person_id(pk) ,let's assume this makes it unique...other columns)
E3 (fax_num(pk)(fk),person_id(pk)(fk))
E2(fax_num(pk)... other columns)
Now my question is what if we keep the Model 1) as it is and just make the person_id in E2 as part of the primary key like E2(fax_num(pk),person_id(pk)(fk)...other columns)...may be I am little confused,but to me it looks fine...anyone please comment and give the answer.
kapoor_dh- Posts : 24
Join date : 2009-12-08
Re: Trivial ques-Resolving a Many-to-Many (m:n) Relationship..why reqd
All of the other columns in your fax entity are repeated for every person that owns that fax number. With model 1 if an attribute of the Fax entity changes, I will need to update multiple rows.
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Similar topics
» Best pratice for resolving Bit operation in Dimension
» Need an Entity-Relationship (ER) Diagram (that describe the relationship between entities)
» 1 to many relationship
» many to many relationship help
» Many to Many to Many relationship
» Need an Entity-Relationship (ER) Diagram (that describe the relationship between entities)
» 1 to many relationship
» many to many relationship help
» Many to Many to Many relationship
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum