0% found this document useful (0 votes)
3 views

5. Data Model

The document provides an overview of Data Models in Database Management Systems, including the Relational, Network, Hierarchical, and ER Models. It discusses the importance of data models for organizing data, their components, and various operations performed on them. Additionally, it highlights the advantages and disadvantages of the Hierarchical Model and includes references for further reading.

Uploaded by

ishaan0643.be21
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

5. Data Model

The document provides an overview of Data Models in Database Management Systems, including the Relational, Network, Hierarchical, and ER Models. It discusses the importance of data models for organizing data, their components, and various operations performed on them. Additionally, it highlights the advantages and disadvantages of the Hierarchical Model and includes references for further reading.

Uploaded by

ishaan0643.be21
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Database Management System (CS-116) Class

On

Database Management System

Dated: 27-06-2022

Department of Computer Science and Engineering,


Chitkara University, Punjab

Prabhjot Chahal DBMS-CS G24


(Data Models)

Data Models: Relational Model, Network Model, Hierarchical Model, ER Model:


Design, issues, Mapping constraints, ER diagram, Comparison of Models.

2
Learning Objective
• Method to organize data required in an application as
relations.
• Importance for an integrated database in organizations.
• Goals of Data Base Management systems (DBMS).
• Entity-Relationship (ER) modeling to develop a conceptual
model of data.
• Structure and organization of DBMS
Learning Outcome
• Define program-data independence, data models for
database systems, database schema and database instances.
• Identify the methodology of conceptual modeling through
Entity Relationship model.
• Identify the methodology of logical model.
• Identify the methodology of physical model.
What is a Data Model?
Definition: precise description of the data content in a
system
• A model is a representation of reality, ‘real world’
objects and events, and their associations.
• It is an abstraction that concentrates on the essential,
inherent aspects of an organization.
• A data model represents the organization itself.
Why do we need to create data
models?
To aid in the development of a sound database design
that does not allow anomalies or inconsistencies

Goal: to create database tables that do not contain


duplicate data values that can become inconsistent
• It should provide the basic concepts that will allow
database designers and end users unambiguously and
accurately to communicate their understanding of the
organizational data.
• It can be defined as an integrated collection of
concepts for describing and manipulating data,
relationships between data, and constraints on the data
in an organization.
Components of Data Model

A data model comprises of three components:


A structural part, consisting of a set of rules according to
which databases can be constructed.
A manipulative part, defining the types of operation that
are allowed on the data.
Possibly a set of integrity rules, which ensures that the
data is accurate.
Categories of Data Models

• The purpose of a data model is to represent data


and to make the data understandable.
• There have been many data models proposed in
the literature. They fall into three broad categories:
– Object Based Data Models
– Record Based Data Models
– Physical Data Models
Categories of data models
• Object Based Data Models: The types of object based data model
are:
Entity-Relationship Model: It has emerged as one of the
main techniques for modeling database design and forms the
basis for the database design methodology.
Object Oriented Model: It extends the definition of an entity
to include, not only the attributes that describe the state of
the object but also the actions that are associated with the
object, that is, its behavior.
Categories of data models
Physical Data Models
• Physical data models describe how data is stored in the
computer, representing information such as record structures,
record ordering, and access paths.
• There are not as many physical data models as logical data
models, the most common one being the Unifying Model.
Categories of data models
• Record Based Data Models
In contrast to object based data models, they are used to
specify the overall logical structure of the database and to
provide a higher-level description of the implementation. The
three most widely accepted record based data models are:
Relational Model
Hierarchical Model
Network Model
Relational Model

• The foundations of Relational Database technology was laid


by Dr. E. F. Codd when he was working for IBM at their San
Jose Research Lab in California.
• The first attempt at a large scale implementation of Codd’s
relational model was IBM’s System R.
• The relational model is a way of looking at data. It’s a
prescription for how to represent and manipulate data.
Relational Data Structure
Contd…..
Supplier Records Relation Name

S_No Name Status City Attribute Name


S1 Suneet 20 Qadian Tuple / Record
S2 Ankit 10 Amritsar
Domain (Type of Data for
S3 Amit 30 Amritsar
an Attribute)

Relation: Supplier Records Tuple: Three Tuples/Records


Attributes: S_No, Name, Status, City Degree: Four (No. of Attributes)
Domain: S_No – Character: Size 2 Cardinality: Three (No. of Tuples)
Name – Character: Size 15 Relational Database: One (No. Tables in a
Database)
Status – Number: 3 digits
City – Character: Size 15
Relational Database.
A database whose logical organization is based on relational
data model is a Relational Database.
Relational Model
The main highlights of this model are −
• Data is stored in tables called relations.
• Relations can be normalized.
• In normalized relations, values saved are atomic values.
• Each row in a relation contains a unique value.
• Each column in a relation contains values from a same domain.
Operation Performed
Contd…..

• Insertion
• Updating
• Deletion
• Retrieval
Hierarchical Model

• Hierarchical Database model is one of the oldest database


models. This model is like a structure of a tree with the
records forming the nodes and fields forming the
branches of the tree.

General Manager

Dy. Gen. Manager Dy. Gen. Manager Dy. Gen. Manager Dy. Gen. Manager

Sales Deptt. Advertisement Deptt. Production Deptt. Quality Mgmt. Deptt.

Employee1 Employee1 Employee1 Employee1


Employee2 Employee2 Employee2 Employee2
Employee3 Employee3 Employee3 Employee3
Employee4 Employee4 Employee4 Employee4
Hierarchical Model
Contd…..

S_No. Name Status City


• Supplier Records S1 Suneet 20 Qadian
S2 Ankit 10 Amritsar
S3 Amit 30 Amritsar

 Part Records
P_No. Name Color Weight City
P1 Nut Red 12 Qadian
S_No. P_No. Qty.
P2 Bolt Green 17 Amritsar
S1 P1 250
P3 Screw Blue 17 Jalandhar
S1 P2 300
P4 Screw Red 14 Qadian
S1 P3 500
S2 P1 250

 Shipment Records S2 P2 500


S3 P2 300

20
Contd…..
Hierarchical Model

P1 Nut Red 12 Qadian P2 Bolt Green 17 Amritsar

S1 Suneet 20 Qadian 250 S1 Suneet 20 Qadian 300


S2 Ankit 10 Amritsar 250 S2 Ankit 10 Amritsar 500
S3 Amit 30 Amritsar 300

P3 Screw Blue 17 Jalandhar P4 Screw Red 14 Qadian

S1 Suneet 20 Qadian 500

Mar 17, Database Management System (DBMS) 21


2025
Operations on Hierarchical Model

Contd…..

• Insert Operation: It is not possible to insert the


information of the supplier e.g. S4 who does not supply
any part.
• This is because a node cannot exist without a root. Since,
a part P5 that is not supplied by any supplier can be
inserted without any problem, because a parent can exist
without any child. So, we can say that insert anomaly
exists only for those children, which has no corresponding
parents.

22
Operations on Hierarchical Model
Contd…..
• Update Operation: Suppose we wish to change the city of
supplier S1 from Qadian to Jalandhar, then we will have to
carry out two operations such as searching S1 for each part
and then multiple updations for different occurrences of S1.

• But if we wish to change the city of part P1 from Qadian to


Jalandhar, then these problems will not occur because there
is only a single entry for part P1.

• The problem of inconsistency will not arise. So, we can say


that update anomalies only exist for children not for parent
because children may have multiple entries in the database.
Operations on Hierarchical Model
• Delete Operation: In hierarchical model, quantity information is
incorporated into supplier record. Hence the only way to delete a
shipment (or supplied quantity) is to delete the corresponding
supplier record. But such an action will lead to loss of information of
the supplier, which is not desired.
• For example: Supplier S2 stops supplying 250 quantity of part P1,
then the whole record of S2 has to be deleted under part P1 which
may lead to loss the information of supplier. Another problem will
arise if we wish to delete a part information and that part happens to
be only part supplied by some supplier.

• The deletion of parent causes the deletion of child records also and if
the child occurrence is the only occurrence in the whole database,
then the information of child records will also be lost with the
deletion of parent. E.g., if we wish to delete the information of part P2
then we also lost the information of S3, S2 and S1 supplier. The
information of S2 and S1 can be obtained from P1, but the
information about supplier S3 is lost with the deletion of record for
P2.
Operations on Hierarchical Model

• Record Retrieval: Record retrieval methods for


hierarchical model are complex and asymmetric which
can be clarified with the following queries:

Query1: Find the supplier number for suppliers who supply


part P2.
• Solution: First we search the information of parent P2
from database, since parent occurs only once in the whole
database, so we obtain only a single record for P2. Then, a
loop is constructed to search all suppliers under this part
and supplier numbers are printed for all suppliers.

Mar 17,
2025
Hierarchical model….contd
• Advantages
– Many of the hierarchical data model’s features formed the
foundation for current data models
– Its database application advantages are replicated, implemented in a
different form, in current database environments
– Generated a large installed (mainframe) base, created a pool of
programmers who developed numerous tried-and-true business
applications
• Disadvantages
– Complex to implement
– Difficult to manage
– Lacks structural independence
– Implementation limitations
– Lack of standards
Rename table

• Rename oldname to newname

• Alter table first rename to firsttable

Rename column with Alter table

• Alter table firsttable rename column srno to


serialno;
References
OTHER REFRENCES
• Hierarchical Model with examples and characteristics | T4Tutorials.com
• Hierarchical model in DBMS (beginnersbook.com)
• ER Diagram: Entity Relationship Diagram Model | DBMS Example (guru99.com)
• Entity Relationship(ER) Model (w3schools.in)
•http://nptel.ac.in/courses/Webcourse-contents/IISc-BANG/notused/IISc/New%20Rajaram%
20pdfs/module8.pdf
•http://ecomputernotes.com/fundamental/what-is-a-database/type-of-data-models
•https://beginnersbook.com/2015/04/data-models-in-dbms/
•http://www.odbms.org/wp-content/uploads/2013/11/Data_Modeling_ConcepttoDBMS.pdf

SUGGESTED BOOK REFERENCES


•Ramez Elmasri and Shamkant B. Navathe,“Fundamentals of Database System”,
The Benjamin / Cummings Publishing Co.
•Korth and Silberschatz Abraham, “Database SystemConcepts”, McGraw Hall.
•Pratt,”DBMS”, Cengage Learning.

You might also like