The ER
The ER
Simple:
They have not been divided into subparts.
Composite:
They have been divided into subparts.
Example: an attribute name could be structured as a
composite attribute consisting of first_name,
middle_initial and last_name.
Single-valued and multi-valued attributes
Single-valued :
The student_id attribute for a specific student entity
refers to only one student ID.
Multi-valued :
An instructor may have zero, one, or several phone
numbers, and different instructors may have different
numbers of phone.
Derived attributes
One to one
One to many
Many to one
Many to many
A directed line from the relationship set
advisor to both entity sets instructor and
student. This indicates that an instructor may
advise at most one student, and a student may
have at most one advisor.
A directed line from the relationship set
advisor to the entity set instructor and an
undirected line to the entity set student.
This indicates that an instructor may advise
many students, but a student may have at
most one advisor.
An undirected line from the relationship set
advisor to the entity set instructor and a
directed line to the entity set student. This
indicates that an instructor may advise at
most one student, but a student may have
many advisors.
Anundirected line from the relationship set
advisor to both entity sets instructor and
student. This indicates that an instructor
may advise many students, and a student
may have many advisors.
An entity set that does not have a primary
key is referred to as a weak entity set.
The existence of a weak entity set depends
on the existence of a identifying or owner
entity set
the identifying relationship is many-to-one from
the weak entity set to the identifying entity set,
and the participation of the weak entity set in
the relationship is total.
Identifying relationship is depicted using a
double diamond.
The discriminator (or partial key) of a weak
entity set is the set of attributes that
distinguishes among all the entities of a weak
entity set.
29
Inheritance - Attributes of supertype apply to
subtype.
E.g., GPA attribute of Student applies to Freshman
Subtype inherits all attributes of supertype.
Key of supertype is key of subtype
Transitivity - Hierarchy of IsA
Student is subtype of Person, Freshman is subtype of
Student
30
Advantage: Used to create a more concise
and readable E-R diagram
Attributes common to different entity sets need
not be repeated
They can be grouped in one place as attributes of
supertype
Attributes of (sibling) subtypes can be different
31
Top-down design process; we designate subgroupings
within an entity set that are distinctive from other
entities in the set.
These subgroupings become lower-level entity sets
that have attributes or participate in relationships
that do not apply to the higher-level entity set.
Depicted by a triangle component labeled ISA (E.g.
customer “is a” person).
Attribute inheritance – a lower-level entity set
inherits all the attributes and relationship
participation of the higher-level entity set to which it
is linked.
A bottom-up design process – combine a number of
entity sets that share the same features into a
higher-level entity set.
Specialization and generalization are simple
inversions of each other; they are represented in an
E-R diagram in the same way.
The terms specialization and generalization are used
interchangeably.
The ISA relationship also referred to as superclass
- subclass relationship
Aggregation is an abstraction through which
relationships are treated as higher level entities.