chapter: 3 data models - parteek bhatia
TRANSCRIPT
![Page 1: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/1.jpg)
Chapter: 3
Data Models
By
Parteek Bhatia
Associate Professor
Department of Computer Science & Engineering
Thapar Institute of Engineering and Technology
Patiala
![Page 2: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/2.jpg)
Data Models
A model is a representation of reality, ‘real world’
objects and events, and their associations.
It is an abstraction that concentrates on the essential.
Simplified Approach to DBMS By Parteek Bhatia
![Page 3: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/3.jpg)
Types of Data Models
Hierarchical Model
Network Model
Relational Model
Simplified Approach to DBMS By Parteek Bhatia
![Page 4: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/4.jpg)
Hierarchical Model
Hierarchical Database model is one of the oldest database
models, dating from late 1950s.
One of the first hierarchical databases Information
Management System (IMS).
This model is based on tree data structure.
Simplified Approach to DBMS By Parteek Bhatia
![Page 5: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/5.jpg)
Hierarchical Model: An Example
Simplified Approach to DBMS By Parteek Bhatia
![Page 6: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/6.jpg)
Hierarchical Model: An Example
Simplified Approach to DBMS By Parteek Bhatia
![Page 7: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/7.jpg)
Hierarchical Model:
Supplier-Part Database
Simplified Approach to DBMS By Parteek Bhatia
![Page 8: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/8.jpg)
Hierarchical Model:
Supplier-Part Database
Simplified Approach to DBMS By Parteek Bhatia
![Page 9: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/9.jpg)
Operations at Hierarchical Model
Simplified Approach to DBMS By Parteek Bhatia
![Page 10: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/10.jpg)
Insert Operation
Cannot insert data of child without parent.
Simplified Approach to DBMS By Parteek Bhatia
![Page 11: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/11.jpg)
Update Operation
The data of child record requires multiple update
operations as their data is repeated.
Simplified Approach to DBMS By Parteek Bhatia
![Page 12: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/12.jpg)
Delete Operations
Parent removal causes deletion of child data.
Simplified Approach to DBMS By Parteek Bhatia
![Page 13: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/13.jpg)
Retrieval Operations are Asymmetric
Query1: Find part numbers for parts supplied by supplier S2.
Algorithm
do until no more parts;
get next part;
get [next] supplier under this part where SNO=S2;
if found then print PNO;
end;
Simplified Approach to DBMS By Parteek Bhatia
![Page 14: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/14.jpg)
Query1: Find supplier numbers who supply part P2.
Algorithm
get [next] part where PNO=P2;
do until no more shipments under this part;
get next supplier under this part;
print SNO;
end;
Simplified Approach to DBMS By Parteek Bhatia
![Page 15: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/15.jpg)
Network Data Model
By
Parteek Bhatia
Associate Professor
Department of Computer Science & Engineering
Thapar Institute of Engineering and Technology
Patiala
![Page 16: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/16.jpg)
Network Model The Network model replaces the hierarchical tree with a
graph thus allowing more general connections among thenodes.
The main difference of the network model from thehierarchical model, is its ability to handle many to many (M:M)relations.
A network structure allows 1:1 (one:one), 1:M (one:many), M:1(many: one), M:M (many:many) relationships among entities.
The network model was evolved to specifically handle non-hierarchical relationships.
Simplified Approach to DBMS By Parteek Bhatia
![Page 17: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/17.jpg)
Network Model: Supplier-Part Database
Simplified Approach to DBMS By Parteek Bhatia
![Page 18: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/18.jpg)
Network Model: Supplier-Part Database
Simplified Approach to DBMS By Parteek Bhatia
![Page 19: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/19.jpg)
Insert Operation
Simplified Approach to DBMS By Parteek Bhatia
![Page 20: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/20.jpg)
Update Operation
Simplified Approach to DBMS By Parteek Bhatia
![Page 21: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/21.jpg)
Delete Operation
Simplified Approach to DBMS By Parteek Bhatia
![Page 22: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/22.jpg)
Retrieve Operation
Simplified Approach to DBMS By Parteek Bhatia
![Page 23: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/23.jpg)
Operations over Network Model Insert
There is no anomaly.
Update There is no anomaly.
Delete There is no anomaly.
Retrieve There is no anomaly, retrieval operations are symmetric.
Limitation of Network Model The only limitation of network model is its complexity.
Simplified Approach to DBMS By Parteek Bhatia
![Page 24: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/24.jpg)
Relational Data Model
By
Parteek Bhatia
Associate Professor
Department of Computer Science & Engineering
Thapar Institute of Engineering and Technology
Patiala
![Page 25: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/25.jpg)
Relational Model
Relational model stores data in the form of tables. This
concept purposed by Dr. E.F. Codd, a researcher of IBM in
the year 1960s. The relational model consists of three
major components:
A relational model database is defined as a database that
allows you to group its data items into one or more
independent tables that can be related to one another by
using fields common to each related table.
Simplified Approach to DBMS By Parteek Bhatia
![Page 26: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/26.jpg)
Relational Model: An Example
Simplified Approach to DBMS By Parteek Bhatia
![Page 27: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/27.jpg)
Relational Model: Customer Loan Database
Simplified Approach to DBMS By Parteek Bhatia
![Page 28: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/28.jpg)
Relational Model: Supplier Part Database
Simplified Approach to DBMS By Parteek Bhatia
![Page 29: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/29.jpg)
For more information
◼ Subscribe to YouTube Channel from the Author
❑ To receive latest video tutorials on Data Mining, Machine Learning,
DBMS, Big Data, NoSQL and many more.
◼ https://www.youtube.com/user/parteekbhatia
![Page 30: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/30.jpg)
![Page 31: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/31.jpg)
Some of online Video Courses created
by Author over Udemy Platform
![Page 32: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/32.jpg)
![Page 33: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/33.jpg)
Online Course on SQL at Udemy
Simplified Approach to DBMS By Parteek Bhatia
![Page 34: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/34.jpg)
![Page 35: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/35.jpg)
![Page 36: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/36.jpg)
![Page 37: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/37.jpg)
![Page 38: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/38.jpg)
![Page 39: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/39.jpg)
Books from the Same Author
For more information visit: www.parteekbhatia.com
Simplified Approach to DBMS By Parteek Bhatia
![Page 40: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/40.jpg)
Coming Soon…
◼ Text Book
◼ Machine Learning: Principles and Practical Techniques
![Page 41: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/41.jpg)
![Page 42: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/42.jpg)
![Page 43: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/43.jpg)
![Page 44: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/44.jpg)
![Page 45: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/45.jpg)
For more information
◼ Please visit: www.parteekbhatia.com
◼ For Feedback: [email protected]
◼ For online Video Courses: https://www.udemy.com/user/parteek-
kumar-4/
◼ For YouTube Channel:
◼ https://www.youtube.com/user/parteekbhatia
◼ For Books: Amazon.in : Parteek Bhatia
◼ For Workshops and invited talks, please write to:
![Page 46: Chapter: 3 Data Models - Parteek Bhatia](https://reader031.vdocuments.mx/reader031/viewer/2022020623/61ef6c2ca3d1ce321e504e10/html5/thumbnails/46.jpg)
Thanks