Professional Documents
Culture Documents
Database Entity Relationship Modelling
Database Entity Relationship Modelling
Lecture 4
Entity/Relationship Modelling
• Entities and Attributes
• Relationships
• Attributes
• E/R Diagram
• Participation constraints
• Cardinality ratios
Entity Relationship Models
• A relationship is an association among several
entities
• Mapping cardinalities, or cardinality ratios,
express the number of entities to which another
entity can be associated via a relationship set.
• Mandatory Relationships
• Optional Relationships
• Many-to-Many Relationships
• One-to-Many Relationships
• One-to-One Relationships
• Recursive Relationships
IT221: Entity Relationship Modelling
Mandatory, Many-to-Many
INSTRUCTOR STUDENT
INSTRUCTOR STUDENT
DEPARTMENT STUDENT
DEPARTMENT STUDENT
INSTRUCTOR SKILL
INSTRUCTOR SKILL
PRODUCT VENDOR
PRODUCT VENDOR
AUTOMOBILE ENGINE
AUTOMOBILE ENGINE
EMPLOYEE
supervises
is supervised by
One Many
Student
Student
Student
Enrols In Student
Takes
Enrols In Student
Takes
Enrols In Student
Takes
Enrols In Student
Takes
Takes
Description Product
Street address
Description Product
Description Product
Has A
Has
ID
(2) Find instances of the Enrolment entity
Enrolment
Code with the same Code as the result of (1)
In
Code
(1) Find the instance of the Module
Module
Title entity with title ‘Database Systems’
IT221: Entity Relationship Modelling
Home work
A database will be made to store information
about patients in a hospital. On arrival, each
patient’s personal details (name, address, and
telephone number) are recorded where possible,
and they are given an admission number. They
are then assigned to a particular ward (Accident
and Emergency, Cardiology, Oncology, etc.). In
each ward there are a number of doctors and
nurses. A patient will be treated by one doctor
and several nurses over the course of their stay,
and each doctor and nurse may be involved with
several patients at any given time.