Академический Документы
Профессиональный Документы
Культура Документы
ER-to-Relational Mapping
Foreign key approach. Add the simple attributes (and simple components
of composite attributes) belonging to the relationship type to one of the
relations (such as S), along with the primary key of the other relation (as
a foreign key).
20
6.3. MAPPING MULTIVALUED
CHAPTER
ATTRIBUTES
6. ER-TO-RELATIONAL MAPPING
Merged relation approach. Combine S and T into a single relation with the
attributes of S and T plus the simple attributes (and simple components
of composite attributes) belonging to the relationship type. The primary
key of the merged relation is the combination of the primary keys of S
and T .
Create a relation for the category with the simple (and simple com-
ponents of composite attributes) attributes of the category type plus
either the primary key of the superclasses as a foreign key (if the
superclasses have a common key) or a new surrogate key (if the su-
perclasses do not have a common key). The surrogate key is also
added as an attribute to the relations corresponding to the relations
for the superclasses. The primary key of the category relation is the
superclass key or the surrogate key.