Professional Documents
Culture Documents
% CS 4400
# ER to Relational Mapping
Three approaches:
1. Foreign keys
2. Merged relation
3. Cross-reference or relationship relation
Two approaches:
1. Foriegn keys
2. Relationship relation schema
Two options:
Create relation schemas for each subclass with all the attributes
of the subclass plus all the attributes of the superclass, and a
primary key chosen from the superclass.
This approach only works for subclasses that are disjoint and
may result in many NULL values if subclasses have many
attributes.
When designing a database schema, the choice of names for entity types, attributes,
relationship types, and (particularly) roles is not always straightforward. One should
choose names that convey, as much as possible, the meanings attached to the
different constructs in the schema. We choose to use singular namesfor entity types,
rather than plural ones, because the entity type name applies to each individual entity
belonging to that entity type. In our ER diagrams, we will use the convention that
entity type and relationship type names are uppercase letters, attribute names have
their initial letter capitalized, and role names are lowercase letters. We have used
this convention in Figure 7.2.