Data Modelling Using ER Diagram
Data Modelling Using ER Diagram
Data Modelling
Entity-Relationship Diagrams
Basic Concepts
Notation
Examples
Entity Relationship Diagramming
Student database
Marks
Link
(relationship
Student File
type) Details
Entity Relationship Diagramming
A bank will store data about all the people (entities) who
do business with them and refer to them generically as
CUSTOMER.
Entities:
Estimate, Order, Customer, Stock Item, Stock Category
Relationships
An Estimate becomes an Order
An Estimate is issued to a particular Customer
An Order refers to Stock Item
A Stock Item belongs to a particular Stock Category
Degree of Relationship
(1:1)
The relationship HEAD-OF between entity types
MANAGER and DEPARTMENT.
This means that a department has at most one head and
that a manager is head of at most one department.
Relationships
(1:N)
The relationship SUPERVISES between the entity types
MANAGER and EMPLOYEE.
This assumes that a manager may supervise any number
of different employees but a given employee is supervised
by at most one manager.
(N:M)
The relationship ASSIGNED-TO between the entity types
EMPLOYEE and PROJECT.
An employee may be assigned to many different projects
and each project may have many employees assigned to it.
Existence Conditions
Terminologies
mandatory
optional
A form has allocated to it a form teacher (mandatory)
A teacher can be allocated to zero or one form (optional)
Notation
A B 1:1
A B 1:N
Examples
has enrolled
COURSE STUDENT
refers to
LOAN BOOK
supplies
SUPPLIER PART
N:M Example Contd
SUPPLIER PART
X
N:M Example Contd
SUPPLIER PART
SUPPLIER_
PART
Guidelines for Drawing an E-R Diagram
WARD DOCTOR
has accommodates
assigned treats
NURSE PATIENT
cares
for
Example
DEPARTMENT
is_in
offers
COURSE LECTURER
teaches_on
enrols
STUDENT
Examples
is associated
Customer Property
can place
Customer Order
teach
Teachers Students