Saturday, June 8, 2013

Handling Many-to-Many relationship in relational model


When doing database design with logical model, we are allowed to create many-to-many (M:N) relationship.
M:N relationship ER modeling

But M:N relationship is not available in relational model. 

In this case, we have break the many-to-many relationship to two (2) one-to-many (1:M) relationship and add an intermediary in between the two entities.
M:N relationship relational modeling
With the above design, TABLE_1 and TABLE_2 are connected, with the M:N relationships stored in the INTERMEDIARY table. 

Oracle SQL Developer Data Modeler

M:N or many-to-many relationships could be easily handled by Oracle SQL Developer Data Modeler with the following steps:

1. Make sure that M:N logical data model has been created in Oracle SQL Developer Data Modeler.
2. click on the Engineer to Relational Model button ()
3. Choose required options > click Engineer.
Engineer to Relational Model dialog


Done!!

LinkWithin

Related Posts Plugin for WordPress, Blogger...