![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi there, This question might be a little off-topic because it isn't related to DB2 - sorry about that. I am reading the book about DBMS from Thomas Connolly to gain deeper understanding about DBMS' and stuggle with one of the recommendations of the logical design. Connolly "recommends" to replace M:N with two 1:N relations. Unfortunatelly, he didn't give a good reason for that and it seems to work on DB2 9.7.4 though. Is there a reason to avoid M:N relations (in general)? Thanks in advance. Kai |
#3
| |||
| |||
|
|
What I ment to say was: the "idea" of a table, that connects two other tables, works for me without massive performance penalties on 9.7.4. |
| On 2011-08-04 17:55:50 +0200, Kai said: Hi there, This question might be a little off-topic because it isn't related to DB2 - sorry about that. I am reading the book about DBMS from Thomas Connolly to gain deeper understanding about DBMS' and stuggle with one of the recommendations of the logical design. Connolly "recommends" to replace M:N with two 1:N relations. Unfortunatelly, he didn't give a good reason for that and it seems to work on DB2 9.7.4 though. Is there a reason to avoid M:N relations (in general)? Thanks in advance. Kai |
#4
| |||
| |||
|
|
I'm not sure I follow, but I'm not familiar with Connolys book. Let's say we have two relations STUDENTS and COURSES that have a N:M relationship, that is a student may take many courses, and a course may have many students. ENROLL STUDENTS : N ------ M : COURSES When implemented in sql the relationship ENROLL usually becomes a new relation (aka table). The relationship between ENROLL and STUDENTS is typically 1:N and the same goes for COURSES and ENROLL. If I get it right you seem to accept this above but question it below? |
|
/Lennart On 2011-08-04 17:55:50 +0200, Kai said: Hi there, This question might be a little off-topic because it isn't related to DB2 - sorry about that. I am reading the book about DBMS from Thomas Connolly to gain deeper understanding about DBMS' and stuggle with one of the recommendations of the logical design. Connolly "recommends" to replace M:N with two 1:N relations. Unfortunatelly, he didn't give a good reason for that and it seems to work on DB2 9.7.4 though. Is there a reason to avoid M:N relations (in general)? Thanks in advance. Kai |
#5
| |||
| |||
|
|
Well, this is how it is implemented but, and that is what is wondering me, Connolly says we should do this while creating the logical design. For me, this makes it more difficult to read and to understand after a while. Let me rephrase my first question: is it bad practice to use M:N relations in ERDs? If so, why? |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
I believe we have good reason though in real world we may just keep it for some special consideration or just by non-mature modeling practice. as we're considering modeling, FK is very important and it is how tables become "related". so the argument is, with many-to-many, we lose the ability of dbms enforced integrity by foreign keys. or say, a normalized model cannot represent many-to-many with foreign keys. |
#8
| |||
| |||
|
|
Connolly says, however, we should always replace M:N relations with two 1:N relations, l |
![]() |
| Thread Tools | |
| Display Modes | |
| |