Save
IM
ENTITY RELATIONSHIP DIAGRAM (ERD)
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Katerina Mae
Visit profile
Cards (23)
ENTITY RELATIONSHIP DIAGRAM (ERD)
- a
high-level data
model.
- used to
define the data elements and
relationships
for a specified system.
- Develops a
conceptual design
for the database.
- Very
simple
and
easy
to design view of data
- Database structure is
portrayed as a diagram
called an
entity relationship diagram
1. ENTITY
- any object, class, person or place.
- represented as rectangles.
A.
STRONG ENTITY
- Will
always have a
primary key (
unique data
)
- Represented by a
single rectangle
B.WEAK ENTITY
- depends on another entity.
- Doesn’t contain any key attribute of its own.
- Represented by a double rectangle
ATTRIBUTE
- Used to describe the
property
of entity.
- ellipse represent an
attribute.
a.
KEY ATTRIBUTE
- Used to represent the
main characteristics
of an
entity.
- Represents a
primary key
- Represented by an
ellipse
with the
text underlined.
b. COMPOSITE
ATTRIBUTE
Composed of many other attributes.
Represented by an
ellipse
, and those ellipses. are connected with an
ellipse.
c.
MULTIVALUED ATTRIBUTE
- Can have more than one value.
- Represented by
double oval.
d.
DERIVED ATTRIBUTE
- Can be derived from other attribute
- Represented by a
dashed ellipse
RELATIONSHIP
- Used to describe the relation between
entities.
- Represented by a
diamond
or
rhombus.
TYPES OF RELATIONSHIP
a.
ONE-TO-ONE
RELATIONSHIP (1:1)
b.
ONE-TO-MANY
RELATIONSHIP (1:M)
c.
MANY-TO-ONE
RELATIONSHIP (M:1)
d.
MANY-TO-MANY
RELATIONSHIP (M:M)
ONE-TO-MANY RELATIONSHIP (1:M)
- One instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship.
ONE-TO-ONE RELATIONSHIP
(1:1)
- Only one
instance
of an entity is associated w/ the
relationship.
MANY-TO-ONE
RELATIONSHIP (M:
1
)
-
relationship between several instances of one entity
and
one instance of another entity.
MANY-TO-MANY RELATIONSHIP (
M
:
M
)
-
relationship is where more than one record in a
table
is related to
more than one record
in another
table.
CARDINALITY
-
Maximum times an
entity can relate to an instance w/ another entity or entity set.
-
Constraints
are within the
maximum
and minimum numbers that are relevant to a relationship.
-
Represented by lines that have different
stylings
depending on the type of
cardinality
that is to be shown.
ORDINALITY
-
Minimum
time an entity can
relate to an
instance
w/ another entity or entity set.
GUIDELINES
IN NAMING RELATIONSHIPS
- r. name is a verb phrase (like Assigned_to, supplies, sends)
- represents action being taken, usually in present tense.
- avoid vague names (Has or is_related_to)
- use
descriptive
,
powerful verb phrases.
CHARACTERISTICS OF RELATIONSHIPS
1.
Degree
2.
Cardinality
DEGREE OF A RELATIONSHIP
- is the number of entity types that participate in it.
a.
Unary Relationship
- When there is an association with only
one
entity.
b. Binary Relationship
- There is an association among
two
entities.
c.
Ternary Relationship
- there is an association among
three
entities