DBMS - Unit-2 (Darshan) (VisionPapers - In)
DBMS - Unit-2 (Darshan) (VisionPapers - In)
GTU # 3130703
Unit-2
Data Models
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 Name
Single
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
Faculty Reports_To
Head
Branch Experience
Post Recursive
Relationship
FName Post Set DName
Ajay Professor Prof. Computer
Haresh Professor Civil
Ramesh HOD Mechanical
C3 L3
A B
Example: A customer is connected with only one loan using the relationship borrower and a
loan is connected with only one customer using borrower.
C3 L3
A B
L4
Example: A loan is connected with only one customer using borrower and a customer is
connected with more than one loans using borrower.
C3 L3
A B
C4
Example: A loan is connected with more than one customer using borrower and a customer is
connected with only one loan using borrower.
C3 L3
A B
C4 L4
Example: A customer is connected with more than one loan using borrower and a loan is
connected with more than one customer using borrower.
C1 L1
Each customer has
maximum one loan C2 L2
C3
Prof. Firoz A Sherasiya #3130703 (DBMS) Unit 2 – Data Models 29
Section - 5
Weak Entity Set
An entity set that does not have a primary key is called weak entity set.
Payment-date
Saving_Account Current_Account
Sub Class
Prof. Firoz A Sherasiya #3130703 (DBMS) Unit 2 – Data Models 34
Section - 7
Generalization v/s Specialization
Generalization Specialization
It extracts the common features of multiple It splits an entity to form multiple new entities
entities to form a new entity. that inherit some feature of the splitting entity.
Name Address Name Address
SPI Salary
Person Person
Name Name
ISA ISA
Address Address
Bottom-up approach
Name Address
PID City
Person
ISA
ISA
Constraints
Disjoint Participation
Disjoint
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).
Non-disjoint
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.
Constraints
Disjoint Participation
Professor Head
(Sub class) (Sub class)
All the players are associated with minimum one sub class either (Batsman or Bowler).
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)
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
Hierarchical Model
Network Model
Entity-relationship Model
Relational Model
Student Professor
The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the
parent nodes.
In hierarchical model, data is organized into tree-like structure with one-to-many relationship
between two different types of data, for example, one department can have many professors
and many students.
B C
D E F
Attributes
RollNo Name BookNo Name
Relationship
Foreign Key
Thank
You