Entity Relationship Model
Entity Relationship Model
Entity Relationship Model
ERD
Outline:
• What Entity relationship diagrams (ERD) are.
• What Entities in an ERD are?
• What Attributes in an ERD are?
• What Relationships in an ERD are?
• How to start an ERD .
ERM and ERD
• Entity-Relationship Data Model (ERM) is a detailed,
logical representation of the data for an organization
or for a business area.
– Expressed in terms of:
• Entities
• Attributes
• Relationships
• Entity-Relationship Diagram (ERD) is a graphical
representation of a Entity-Relationship Model.
ERD
• The purpose of an ERD is to capture the
richest possible understanding of the meaning
of data necessary for an information system or
organization.
Entity
Entity Entity
Entity Types
(Defining Guidelines)
• An Entity type definition should:
– Include a statement of what the unique
characteristics are for each instance.
– Make clear what entity instances are included and
not included.
– Include a description of when an instance of the
entity type is created and deleted.
– Specify when an instance might change into an
instance of another entity type.
– Specify what history is to be kept about entity
instances.
Attributes
Student
Student_ID
Student_Address
Student_Phone
Attributes
(Naming Guidelines)
• An attribute name:
– Should be a noun and capitalize the first letter of
each word. (Example: Student_ID.)
– Should be unique.
– Should follow a standard format. (Example:
Student_GPA, not GPA_of_Student.)
• Similar attributes of different entity types
should use similar but distinguished names.
– Example: Faculty_Residence_City_Name and
Student_Residence_City_Name
Attributes
(Defining Guidelines)
Relationship
Relationship
Relationships
(Naming Guidelines)
Is_married_to Manages
PERSON EMPLOYEE
One-to-one One-to-many
Binary Relationship
• Relationship between the instances of two entity
type.
Is_assigned Contains
PARKING
EMPLOYEE PRODUCT
SPACE PRODUCTS
LINE
One-to-One One-to-Many
PART
VENDOR WAREHOUSE
Supplies
Guidelines for Drawing ERDs
• Lay out the diagram with minimal line crossing.
• Place subject entity types on the top of the diagram.
• Place plural entity types below a single entity type in a one-to-many
relationship.
• Place entity types participating in one-to-one and many-to-many
relationships alongside each other.
• Group closely related entity types when possible. Try to keep the
length of relationship lines as short as possible. Also try to minimize
the number of changes of direction in a single line.
• Show the most relevant relationship name. One name must always
be shown.