ER Diagram
ER Diagram
ER Diagram
Relationship
Diagram
ER Diagram
ENTITY RELATIONAL (ER) MODEL is a high-level conceptual data
model diagram.
• It’s a pictorial representation.
Why ER diagram
• ER modeling helps you to analyze data requirements systematically
to produce a well-designed database.
• The Entity-Relation model represents real-world entities and the
relationship between them.
• It is considered a best practice to complete ER modeling before
implementing your database.
Basic structure
● An entity set is a set of entities of the same type that share the same
properties.
Example: set of all persons, companies, trees, holidays.
Basic structure
Example:
44553 (Peltier) advisor 22222 (Einstein)
student entity relationship set instructor entity
PHONE
ADDRESS NUMBER NAME
ID
PERSON
Types of Attributes
Street_
city Aadhar_no
_no
PERSON
Key
Derived attribute
DOB
age attribute
Relationship
• How to represent relationship between the entities ?
Employee
prerequisite
prereq_id Course_id
Course
Degree of Relationship:
• The number of participating entities in a relationship defines the
degree of the relationship.
• Binary = degree 2
Binary
• Ternary = degree 3
• n-ary = degree
Instructor
ternary
allot_
student grade course
N-ary relationship
Instructor
n-ary
class_room
project supervisor
Employee Department
Identify Attributes
• A company has several departments. Each department has
a supervisor and at least one employee. Every supervisor
has only one department under him. Employees must be
assigned to at least one, but possibly more departments. At
least one employee is assigned to a project. Each employee
is assigned atleast one project. The important data fields are
the names of the departments, projects, supervisors and
employees, as well as the supervisor and employee
number and a unique project number.
Attributes
S_id S_name
P_name P_no
project supervisor
Employee Department
project supervisor
assi ma
gne nag
d es
work
Employee s Department