Title: Entity Relationship Modeling
1Entity Relationship Modeling
2Entity Relationship Diagram
An Entity Relationship Diagram (ERD) is used to
represent the Entity Relationship Model of a
Logical Schema (Logical View) of a Database. It
describes in a very macro manner the Entities and
Relationships involved in a system. The ERD has
been adopted as the standard for documentation
and communication in industry (but variations
abound).
3Entity
Any distinguishing Object that is to be (or
being) represented. An Object about which we
want to record data. Usually has a Noun as its
name. For example, an Employee. Entity Class - A
Group of Entities with the same Attributes and
are related to each other. For example, Employees.
4Attribute
Entity
A Characteristic of an Entity. Usually has an
Adjective as its name. Its value must come from
the Attributes Domain. Domain - described by
Type, Size and the set of Possible and Valid
values.
5Relationship
Entity
Entity
Connections or mappings superimposed on the
Entities. Could be within or among Entity
Classes. Usually has a Verb as its name. Binary
Relationships - Basic building blocks.
1 1 One to One 1 M One to
Many (Parent/Child) M N Many to Many
6Relationship
1 1 One to One
Entity B
Entity A
Entity B
1 M One to Many
Entity A
Entity B
M N Many to Many
Entity A
7The Cardinality of a Relationship
Two Notations
(0,1)
Min 0 Max 1 Zero or One (Optional)
Min 1 Max 1 One and Only One (Mandatory)
(1,1)
Min 0 Max Many Zero or Many (Optional)
(0,N)
(1,N)
Min 1 Max Many One or Many (Mandatory)
8Some Common Relationship Structures
A Tree or Hierarchy Each Entity has only one
Parent
A
1 M
A
B
B
9Some Common Relationship Structures
A Simple Network Entities can have more than one
Parent
A
B
A
B
1 M
1 M
1 M
C
D
C
D
10Some Common Relationship Structures
A Complex Network Entities can have more than one
Parent
A
A
M N
B
B
11Some Common Relationship Structures
A Unary Relationship (1 M or M N) Entity is
related to Itself
A
A
M N
Sometimes called a Recursive or the
Bill-of-Material (BOM) Relationship.
12Bank Database Schema Example
13Inventory Database Schema Example