2.introduction To The Relation Models and Database Design Using ER Model
2.introduction To The Relation Models and Database Design Using ER Model
Data Models
Outline
Looping
• Basic concept of E-R diagram
• Types of Attributes
• Mapping Cardinality
• Weak Entity Sets
• Extended E-R features
• Generalization and Specialization
• Constraints on Specialization and
Generalization
• Aggregation
• E-R diagram of Hospital Management System
• Reduction to E-R Database Schema
• Database Models
• Integrity Constraints
Basic concept of E-R diagram
Section - 1
Basic concepts
What is Database Design?
Database Design is a collection of processes that facilitate the designing, development, implementation
and maintenance of enterprise database management systems.
What is E-R diagram?
E-R diagram: (Entity-Relationship diagram)
It is graphical (pictorial) representation of database.
It uses different types of symbols to represent different objects of database.
Relationship
Name
Symbol
Each and every entity must have one primary key attribute.
Relationship between 2 entities is called binary relationship.
Project
Middle name
Roll No Phone No
Middle
Name
First Name Last
Single Name
Simple
Value
RollNo Name Composite Apartment
Derived Composite
Multiple Stored
Value
Phone No Birth Date Area
Descriptive
Attribute
Issue
RollNo Name Date BookNo Name
EmpID Name
Coordinator
Reports_T
Faculty
o
Head
Branch Experience
Post Recursive
Relationship
FName Post Set DName
Ajay Professor Prof. Computer
f.
Haresh Professor PPrroof./ Civil
HOD
Ramesh HOD Mechanical
Example: A customer is connected with only one loan using the relationship borrower and a
loan is connected with only one customer using borrower.
Example: A loan is connected with only one customer using borrower and a customer is
connected with more than one loans using borrower.
Example: A loan is connected with more than one customer using borrower and a
customer is connected with only one loan using borrower.
Example: A customer is connected with more than one loan using borrower and a loan is
connected with more than one customer using borrower.
Payment-date
Saving_Account Current_Account
Sub Class
Unit 2 – Data Models 34
Generalization v/s
Specialization
Section - 7
Generalization v/s Specialization
Generalization Specialization
It splits an entity to form multiple new
It extracts the common features of multiple
entities that inherit some feature of the
entities to form a new entity.
splitting entity.
Name Address Name Address
Salar
SPI
Person Person y
Name Name
IS IS
Top-down approach
Address A Address A
Bottom-up
approach
Salar Salar
SPI SPI
y y
Name Address
PID City
Person
IS
A
Salar Balanc
Employee Customer
y e
IS
A
Days
Hour Worked
Worked
Constraints
Disjoint Participation
Disjoin
t
Batsman Bowler ISA
(Sub class) (Sub class)
Full-time Part-time
(Sub class) (Sub class)
All the players are associated with only one sub class either (Batsman or
Bowler).
Unit 2 – Data Models 43
Non-disjoint (Overlapping) Constraint
It specifies that an entity of a super class can belong to more than one lower-level entity
set (sub class).
Specified by ‘o’ or by writing overlapping near to the ISA triangle.
Employee
Cricketer (Super class)
(Super class)
disjoint
Non-
Batsman Bowler ISA
(Sub class) (Sub class)
Faculty Head
(Sub class) (Sub class)
One player (Yuvraj singh) is associated with more than one sub
class.
Unit 2 – Data Models 44
Constraints on Specialization and Generalization
Constraints
Disjoint Participation
Professor Head
(Sub class) (Sub class)
All the players are associated with minimum one sub class either (Batsman or
Bowler).
Unit 2 – Data Models 47
Partial (Optional) Participation
Partial participation specifies that every entity in the super class does not belong to any of
the subclass of specialization.
Specified by a single line in E-R diagram.
Employee
Cricketer (Super class)
(Super class)
Professor Head
(Sub class) (Sub class)
Customer
Company
Borrow Borrow
Loan Loan
MRID
PatID Name HosID Name
Indoor Outdoor
Doctor
RoomNo
IPDID OPDID DrID Dr Name
Charge
PhoneNo (T2)
RollNo Name
Student SPI
Disjoint
E R E ISA ISA
One to One Total Disjoint
Specialization/ Specialization/
E R E Generalization Generalization
One to Many
E R E Overlapping