E-R Diagram:
Capture reality. Do not need to think about using characters or string for ID field instead of # in the table.
Entity with Attributes
Relationship
Constraints:
Domain Constraint
-
valid value for each attribute. Use separate table to describe them.
Key Constraint -
e.g.
.
Each department has at most one manager.
Participation Constraint -
e.g. Every department is required to have a manager.
Type of Relationship Constraints
:
One to One
(at most one to the other side)
One to Many
Many to Many
Binary Relationship vs. Ternary Relationship
Courses-Students-Teachers
Restaurant-Food-Supplier
The case of aggregation
Insurance Policies - Figures 2.18 & 2.19 on pages 42 & 43
Weak Entities
Class Hierarchies
(
See
f
igure 2.12 on page 36
- Employee is a Hourly_Emps or a Contract_Emps.
)
(
Subset
concept)
Overlap constraints - (eg. Contract_Emps & Senior_Emps)
Covering constraints - (eg. Hourly_Emps & Contract_Emps vs. Employee)
See
restaurant example
Aggregation vs. Ternary Relationship