T2 L5 DB LogicalDesign
T2 L5 DB LogicalDesign
Weak entity Create a relation that contains all simple attributes - primary key must take
into account the owner entity’s key
*:* binary relationship Create a relation for the relationship, including all relationship attributes.
Each entity in the relation is a foreign key in the relationship’s relation.
Multi-valued attributes Define a relation for the multi-valued attribute and create a foreign key to the
relation representing the containing entity
Complex relationship Create a relation for the relationship, including all relationship attributes.
Each entity in the relation is a foreign key in the relationship’s relation.
Maps to a foreign key
Entity/Relationship Mapping to logical design
1:* binary relationship Define a foreign key on the “many” side. It points to a candidate key on
the “1” side”. All relationship attributes are stored in the “many”
relationship. No relation necessary for relationship.
*:* binary relationship Create a relation for the relationship, including all relationship attributes.
Each entity in the relation is a foreign key in the relationship’s relation.
Multi-valued attributes Define a relation for the multi-valued attribute and create a foreign key to
the relation representing the containing entity
Superclass/Subclass conversion
Participation Disjoint constraint Mapping to logical design
Optional Nondisjoint (AND) Two relations, 1 relation for the superclass and 1
relation for all of the subclasses, subclass needs a
discriminating attribute to differentiate type of subclass
Optional Disjoint (OR) Many relations, one relation for the superclass, one
relation for each subclass
Normalization is covered
In a separate presentation.
Check integrity constraints
Types of integrity constraints
1. Identifying attributes that are required
a. For each column decide if it needs to have a value
2. Attribute domain constraints
a. List or describe the legal values for each attribute (NULL allowed?)
3. Multiplicity
a. Ensure the relationship constraints are properly represented
4. Entity integrity
a. Primary key attributes cannot hold a NULL value
5. Referential integrity
a. Foreign key created in the child tuple linking to existing parent tuple
6. General constraints
Referential integrity defines DB behavior
Define the desired database behavior to ensure that a child relation NEVER
references a parent relation instance that does not exist.