Professional Documents
Culture Documents
7.2
Design Phases
The initial phase of database design is to characterize fully the data
7.3
database
7.4
Design Approaches
Entity Relationship Model (covered in this chapter)
7.5
7.6
entity sets,
relationship sets,
attributes.
7.7
Entity Sets
An entity is an object that exists and is distinguishable from
other objects.
Example:
instructor = (ID, name, street, city, salary )
course= (course_id, title, credits)
7.8
student-ID student_name
7.9
Relationship Sets
A relationship is an association among several entities
Example:
44553 (Peltier)
student entity
advisor
relationship set
22222 (Einstein)
instructor entity
Example:
(44553,22222) advisor
7.10
7.11
instructor and student may have the attribute date which tracks when
the student started being associated with the advisor
7.12
Relationships between more than two entity sets are rare. Most
7.13
One to one
One to many
Many to one
Many to many
7.14
Mapping Cardinalities
One to many
One to one
7.15
Mapping Cardinalities
Many to one
Many to many
7.16
Complex Attributes
Attribute types:
Derived attributes
7.17
Composite Attributes
7.18
Redundant Attributes
Suppose we have entity sets:
7.19
7.20
The notion of weak entity set formalizes the above intuition. A weak
7.21
7.22
E-R Diagrams
7.23
Entity Sets
Entities can be represented graphically as follows:
7.24
Relationship Sets
Diamonds represent relationship sets.
7.25
7.26
Roles
Entity sets of a relationship need not be distinct
7.27
Cardinality Constraints
We express cardinality constraints by drawing either a directed line
7.28
One-to-Many Relationship
one-to-many relationship between an instructor and a student
7.29
Many-to-One Relationships
In a many-to-one relationship between an instructor and a student,
7.30
Many-to-Many Relationship
An instructor is associated with several (possibly 0) students via
advisor
advisor
7.31
7.32
shown in the form l..h, where l is the minimum and h the maximum
cardinality
A minimum value of 1 indicates total participation.
A maximum value of 1 indicates that the entity participates in
7.33
7.34
line.
The relationship set connecting the weak entity set to the identifying
7.35
7.36
7.37
a collection of schemas.
For each entity set and relationship set there is a unique schema that
7.38
7.39
attributes for the primary keys of the two participating entity sets,
and any descriptive attributes of the relationship set.
7.40
schema is
instructor(ID,
first_name, middle_initial, last_name,
street_number, street_name,
apt_number, city, state, zip_code,
date_of_birth)
7.41
separate schema EM
represented by a schema:
inst_phone= ( ID, phone_number)
7.42
Redundancy of Schemas
Many-to-one and one-to-many relationship sets that are total on the
7.43
7.44
7.45
Advanced Topics
7.46
7.47
If there is more than one arrow, there are two ways of defining the
meaning.
2.
Each pair of entities from (A, B) is associated with a
unique C entity, and each pair (A, C) is associated
with a
unique B
7.48
Specialization
Top-down design process; we designate sub-groupings within
an entity set that are distinctive from other entities in the set.
is a person).
7.49
Specialization Example
Overlapping employee and student
Disjoint instructor and secretary
Total and partial
7.50
attributes
ID, name, street, city
ID, tot_cred
ID, salary
7.51
Form a schema for each entity set with all local and inherited
attributes
schema
person
student
employee
attributes
ID, name, street, city
ID, name, street, city, tot_cred
ID, name, street, city, salary
7.52
Generalization
A bottom-up design process combine a number of entity
sets that share the same features into a higher-level entity set.
interchangeably.
7.53
the higher-level entity set must belong to at least one of the lowerlevel entity sets within a generalization.
7.54
Aggregation
Consider the ternary relationship proj_guide, which we saw earlier
Suppose we want to record evaluations of a student by a guide
on a project
7.55
Aggregation (Cont.)
Relationship sets eval_for and proj_guide represent overlapping
information
7.56
Aggregation (Cont.)
Eliminate this redundancy via aggregation without introducing
7.57
In our example:
7.58
Design Issues
7.59
7.60
Possible guideline is to designate a relationship set to describe an action that occurs between entities
7.61
Example: proj_guide
7.62
2. add (ei , ai ) to RA
3. add (ei , bi ) to RB
4. add (ei , ci ) to RC
7.63
7.64
relationship set.
relationships.
in the design.
single unit without concern for the details of its internal structure.
7.65
7.66
7.67
Alternative ER Notations
Chen, IDE1FX,
7.68
Alternative ER Notations
Chen
7.69
UML
UML: Unified Modeling Language
UML has many components to graphically model different aspects
differences.
7.70
7.71
Equivalent in UML
7.72
line connecting the entity sets. The relationship set name is written
adjacent to the line.
specified by writing the role name on the line, adjacent to the entity
set.
7.73
End of Chapter 7