Beruflich Dokumente
Kultur Dokumente
• Data Dictionary
(Foreign Key)
Referential
integrity
constraints are
implemented
with foreign key
to primary key
references
Well Structured Relation :
Insertion Anomaly/Irregularity/Inconsistency:
• Suppose that we need to add a new employee to the table shown in
next slide. The primary key for this relation is the combination of
Emp_ID and Course_Title. There fore, to insert a new record, the user
must supply values for both Emp_ID and Course_Title(because
primary key values can not be null or non existent). This is an
anomaly. Because the user should not be able to enter only employee
data without supplying course data.
Example of an Insertion, Deletion & Modification Anomaly/Irregularity/Inconsistency
EMPLOYEE_to_COURSE:
• An EMPLOYEE must studies at least one COURSE. A COURSE must be
studied by one or more than one EMPLOYEE's(MANY_to_MANY type
of Relationship).
EMPLOYEE_to_DEPARTMENT:
• An EMPLOYEE must do his/her job in at most one DEPARTMENT. In a
DEPARTMENT at most one EMPLOYEE must do his/her
job(ONE_to_ONE type of Relationship).
Transforming/Mapping ENTITIES into Relations
(Tables)
• Mapping Regular Entities to Relations
1.Simple Attributes: E-R attributes map directly onto the relation
2.Composite Attributes: Use only their simple, component attributes
3.Multivalued Attribute: Becomes a separate relation with a foreign
key taken from the superior entity.
Mapping a Regular Entity
(a) CUSTOMER entity type with
simple attributes
EMPLOYEE 2 Relation:
Mapping an Entity with a Multivalued Attribute
(a) Bill-of-materials
relationships (M:N):
• One relation for each entity and one for the Associative entity