|
In this step all binary relationships many to many (0,n)(0,n), (1,n) (0,n) or (1,n)(1,n) are transformed into the relational database scheme.
Search for all regular binary relationships B of type many to
many and the according relational schemes S and T. For each B create a new
relational scheme R. The primary keys of S and T are used as foreign keys in R.
Together they form the primary key of this new relational scheme R. Also add
the properties (if there are any) of B as attributes into this relational
scheme R.
In this example you can see the application
A binary relationship of type many to many ((0,n)(0,n)-, (0,n)(1,n)- and
(1,n)(1,n)) is chosen:
"published in"
For this relationship we define a new relational scheme:
AdpublishedInNewspaper
The primary keys of the connected relational schemes S and
T are used as foreign key in the new scheme R. Together they form the primary
key for R:
AdpublishedInNewspaper
(Ad_OrderNo,
Newspaper_Name)
Now the properties of the relationship are used as
attributes in the relational scheme:
AdpublishedInNewspaper
(NameAd_OrderNo, Newspaper_Name, Position)