Beruflich Dokumente
Kultur Dokumente
Diagram
ERD
Background
Peter Chen developed ERDs in 1976.
Charles Bachman and James Martin
have added some slight refinements
to the basic ERD principles.
ER Model
Anentity-relationship model(ERM) is a
conceptual way of showing
datarelationshipsin software
development.
ERM is a databasemodelingtechnique
that generates an abstract diagram or
visual representation of a system's data
that can be helpful in designing a
relational database.
Components of ER model
Entity
Relationship
Attribute
Entity
Entities are objects or concepts that represent
important data. They are typically nouns,
e.g.customer,supervisor,location or promotion.
Strong entitiesexist independently from other
entity types. They always possess one or more
attributes that uniquely distinguish each
occurrence of the entity. E.g. student
Weak entitiesdepend on some other entity type.
They don't possess unique attributes (also known
as a primary key) and have no meaning in the
diagram without depending on another entity. E.g.
course
Representation in ERD
Entities are represented by
rectangles.
Attribute
Attributesare characteristics of either an
entity, a many-to-many relationship, or a
one-to-one relationship.
Multivalued attributesare those that
are capable of taking on more than one
value. E.g. phone number
Derived attributesare attributes whose
value can be calculated from related
attribute values. E.g. age
Composite attributesare those that can
be further subdivided. E.g. name, address
Representation in ERD
Attributes are represented by means
of ellipses.
Representation in ERD
Relationships are represented by diamondshaped box.
Name of the relationship is written inside
the diamond-box.
All the entities (rectangles) participating in
a relationship, are connected to it by a
line.
One to one
One-to-one When only one
instance of an entity is associated
with the relationship, it is marked as
'1:1'.
One to many
When more than one instance of an
entity is associated with a
relationship, it is marked as '1:N'.
Many to many
The following image reflects that more than one
instance of an entity on the left and more than
one instance of an entity on the right can be
associated with the relationship.
Representation I
Representation II
Representation III
Representation IV
Identify entities
Identify relationships
Describe the relationship
Add Attributes
Complete the diagram
Step 1
The first step in making an ERD is to
identify all of the entities you will use.
An entity is nothing more than a
rectangle with a description of something
that your system stores information about.
This could be a customer, a manager, an
invoice, a schedule, etc.
Draw a rectangle for each entity you can
think of on your page.
Step 2
Look at two entities, are they
related?
If so draw a solid line connecting the
two entities.
Step 3
How are the entities related?
Draw an action diamond between the
two entities on the line you just
added.
In the diamond write a brief
description of how they are related.
Step 4
Any key attributes of entities should
be added using oval-shaped symbols.
Step 5
Continue to connect the entities with
lines, and adding diamonds to
describe each relationship until all
relationships have been described.
Each of your entities may not have
any relationships, some may have
multiple relationships. That is okay.
Sample ERD
Exercise
ssn
What can
you say
about
policy of
the bank
from the
ER
diagram?
What can
name
CustAcct
Customer
ssn
name
acct#
addr
balance
Account
lot
Employees
Manages
Dept
deptid
budget
EXERCISE
Case Study
Odeon Cinema and other
international cinemas have decided
to install a centralized database. This
database should keep information
regarding cinemas including its
name, address and phone number.
Each cinema must have one or more
theaters and each theater has a
specific showing time. During these
showing times a movie is shown to
Entities
CINEMA
THEATER
SHOW
MOVIE
Relationships
A CINEMA must contain one or more
THEATERS. A THEATER must belong to
one CINEMA only.
A THEATER has one or more SHOW times.
A particular SHOW time for a movie must
belong to one THEATER only
A MOVIE can have many SHOW times and
a particular SHOW time at a THEATER
must belong to one MOVIE only.
Attributes
CINEMA
Cinema_ID
Cinema_Name
Cinema_Address
Cinema_Phone
THEATER
Theater_ID
Theater_Capacity
SHOW
Show_Time
Show_Date
Show_Attendence
MOVIE
Movie_ID
Movie_Title
Movie_Director
Movie_Rating
ENTITY RELATIONSHIP
DIAGRAM
Practice
ERD Tools
RISE Editor
ER Studio
ERwin
Smart Draw
Rational Rose
Magic Draw