Entity Relationship Diagram (Er-Diagram) BY Debraj Chatterjee
Entity Relationship Diagram (Er-Diagram) BY Debraj Chatterjee
BY
DEBRAJ CHATTERJEE
E-R Model
• Has its own identity that distinguishes Entity type name should be:
it from other entities. • A singular noun and in
capital letters.
• Examples:
• Person: PROFESSOR, STUDENT
• Descriptive and specific to
the organization.
• Place: STORE, UNIVERSITY
• Object: MACHINE, BUILDING • Concise.
• Event: SALE, REGISTRATION • Named for the result of the
• Concept: ACCOUNT, COURSE event, not the activity or
process of the event.
EXAMPLES
•One-to-one: An entity in A is associated with at most one entity in B, and
an entity
in B is associated with at most one entity in A.
A man may be married to at most one women, and woman may be
married to at most one man (both men and women can be
unmarried)
since
name name
Is
Men Married Women
to
Is Married to
•One-to-many: An entity in A is associated with any number in B. An
entity in B is
associated with at most one entity in A.
A women may be the mother of many (or no) children. A person
may have at most one mother.
Born on
name name
Is
Women' Low I.Q.
s Club
Mother
of Club
Is mother of
•Many-to-one: An entity in A is associated with at most one entity in B.
An entity in
B is associated with any number in A.
Many people can be born in any county, but any individual is born
in at most one country.
year
name Capital
Was
Bowling Country
Born
Club
in
Was born in
•Many-to-many: Entities in A and B are associated with any number
from each other.
Since
name name
Is
Girls Boys
Classmate
of
Is Classmate of
UNIVERSITY ENTITY-RELATIONSHIP DIAGRAM
Entity
ATTRIBUTES
• Each Entity has a set of Attributes
• Attribute is a property or characteristic of an entity that is of interest to the
organization.
• Example: [STUDENT: Student_ID, Student_Name, Phone_Number, Major]
• 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
• An attribute definition should:
• State what the attribute is and why it is important.
• Make clear what is and isn’t included in the attribute's value.
• Define any aliases.
• Indicate if the attribute is required or not.
• Indicate any relationships with other attributes.
Student
Student_ID
Student_Address
Student_Phone
RELATIONSHIPS
• Relationships are associations between one or more entity types.
• The degree of a relationship = is the number of entity types that participate in a relationship. There are 3
common relationships:
1. Unary (degree one) 2. binary (degree two) 3. Ternary (degree three)
Relationship
UNARY RELATIONSHIP
Is_married_to Manages
EMPLOYEE
PERSON
One-to-one One-to-many
BINARY RELATIONSHIP
• Relationship between the instances of two entity type.
Is assigned Contains
One-to-One One-to-Many
PARKING
EMPLOYEE PRODUCT
SPACE PRODUCTS
LINE
PART
VENDOR WAREHOUSE
Supplies
STARTING AN ER-D