0% found this document useful (0 votes)
35 views21 pages

RDBMSPGChapter 2

The document discusses different data models used in databases. It describes hierarchical, network, entity-relationship, and relational data models. For each model, it provides examples to illustrate the structure and relationships represented by the model. It also outlines some key advantages and disadvantages of each data model type.

Uploaded by

Alkesh yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views21 pages

RDBMSPGChapter 2

The document discusses different data models used in databases. It describes hierarchical, network, entity-relationship, and relational data models. For each model, it provides examples to illustrate the structure and relationships represented by the model. It also outlines some key advantages and disadvantages of each data model type.

Uploaded by

Alkesh yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

CHAPTER-2

DATA MODELS

A study material for the students of GLS University


FCAIT - MSc-(IT)

DATA MODELS
l A data model is a relatively simple representation, usually
graphical, of more complex real-world data structures.
l A model is an abstraction of a more complex real-world object
or event.
l A model’s main function is to help you understand the
complexities of the real-world environment.
l Within the database environment, a data model represents data
structures and their characteristics, relations, constraints,
transformations, and other constructs with the purpose of
supporting a specific problem domain.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

DATA MODELS
Types of Data Models:
• Hierarchical Model
• Network Model
• Entity-Relationship Model
• Relational Model
• Object-Oriented Data Model

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

HIERARCHICAL MODEL
• The hierarchical model can be represented by an upside-down tree.
• The hierarchical model depicts a set of one-to-many (1:M) relationships
between a parent and its children segments. (Each parent can have many
children, but each child has only one parent.)
Ø Hierarchical Model was the first DBMS model.
Ø This model organises the data in the hierarchical tree structure. The
hierarchy starts from the root which has root data and then it expands in
the form of a tree adding child node to the parent node.
Ø This model easily represents some of the real-world relationships like
food recipes, sitemap of a website etc.
Ø Ex: We can represent the relationship between the shoes present on a
shopping website in the following way:
Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

HIERARCHICAL MODEL
Features of a Hierarchical Model
Ø One-to-many relationship: The data here is organised in a tree-like
structure where the one-to-many relationship is between the datatypes.
Also, there can be only one path from parent to any node. Example: In
the above example, if we want to go to the node sneakers we only
have one path to reach there i.e through men's shoes node.
Ø Parent-Child Relationship: Each child node has a parent node but a
parent node can have more than one child node. Multiple parents are
not allowed.
Ø Deletion Problem: If a parent node is deleted then the child node is
automatically deleted.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

HIERARCHICAL MODEL

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

HIERARCHICAL MODEL

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

HIERARCHICAL MODEL
Advantages of Hierarchical Model:
Ø It is very simple and fast to traverse through a tree-like structure.
Ø Any change in the parent node is automatically reflected in the child node so,
the integrity of data is maintained.
Disadvantages of Hierarchical Model:
Ø Complex relationships are not supported.
Ø As it does not support more than one parent of the child node so if we have
some complex relationship where a child node needs to have two parent node
then that can't be represented using this model.
Ø If a parent node is deleted then the child node is automatically deleted.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

NETWORK MODEL
Ø This model is an extension of the hierarchical model. It was the most
popular model before the relational model.
Ø This model is the same as the hierarchical model, the only difference is
that a record can have more than one parent. It replaces the hierarchical
tree with a graph.
Ø Ex: In the example below we can see that node student has two parents
i.e. CSE Department and Library. This was earlier not possible in the
hierarchical model.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

NETWORK MODEL

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

NETWORK MODEL
Advantages of Network Model
Ø The data can be accessed faster as compared to the hierarchical model.
This is because the data is more related in the network model and there
can be more than one path to reach a particular node. So the data can be
accessed in many ways.
Ø As there is a parent-child relationship so data integrity is present. Any
change in parent record is reflected in the child record.
Disadvantages of Network Model
Ø As more and more relationships need to be handled the system might
get complex. So, a user must be having detailed knowledge of the
model to work with the model.
Ø Any change like updation, deletion, insertion is very complex.
Prepared
Ø by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

ENTITY-RELATIONSHIP MODEL
Entity-Relationship Model
Entity-Relationship Model or simply ER Model is a high-level data model
diagram. In this model, we represent the real-world problem in the pictorial
form to make it easy for the stakeholders to understand. ER diagram has
the following three components:
Entities: Entity is a real-world thing. It can be a person, place, or even a
concept. Example: Teachers, Students, Course, Building, Department, etc
are some of the entities of a School Management System.
Attributes: An entity contains a real-world property called attribute. This
is the characteristics of that attribute. Example: The entity teacher has the
property like teacher id, salary, age, etc.
Relationship: Relationship tells how two entities are related.
Ex: Teacher works for a department.
Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

ENTITY-RELATIONSHIP MODEL

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

ENTITY-RELATIONSHIP MODEL
Features of ER Model
• Graphical Representation for Better Understanding: It is very
easy and simple to understand so it can be used by the developers to
communicate with the stakeholders.
• ER Diagram: ER diagram is used as a visual tool for representing
the model.
• Database Design: This model helps the database designers to build
the database and is widely used in database design.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

ENTITY-RELATIONSHIP MODEL
Advantages of ER Model
• Simple: Conceptually ER Model is very easy to build. If we know
the relationship between the attributes and the entities we can easily
build the ER Diagram for the model.
• Effective Communication Tool: This model is used widely by the
database designers for communicating their ideas.
• Easy Conversion to any Model: This model maps well to the
relational model and can be easily converted relational model by
converting the ER model to the table. This model can also be
converted to any other model like network model, hierarchical model
etc.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

ENTITY-RELATIONSHIP MODEL
Disadvatages of ER Model
• No industry standard for notation: There is no industry standard
for developing an ER model. So one developer might use notations
which are not understood by other developers.
• Hidden information: Some information might be lost or hidden in
the ER model. As it is a high-level view so there are chances that
some details of information might be hidden.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

RELATIONAL MODEL
• In this model, the data is maintained in the form of a two-dimensional
table. All the information is stored in the form of row and columns.
• The basic structure of a relational model is tables. So, the tables are
also called relations in the relational model. Example: In this
example, we have an Employee table.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

RELATIONAL MODEL
Features of Relational Model
Tuples: Each row in the table is called tuple. A row contains all the
information about any instance of the object. In the above example, each
row has all the information about any specific individual like the first
row has information about John.
Attribute or field: Attributes are the property which defines the table or
relation. The values of the attribute should be from the same domain. In
the above example, we have different attributes of the employee like
Salary, Mobile_no, etc.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

RELATIONAL MODEL
Advantages of Relational Model
Simple: This model is more simple as compared to the network and
hierarchical model.
Scalable: This model can be easily scaled as we can add as many rows
and columns we want.
Structural Independence: We can make changes in database structure
without changing the way to access the data. When we can make
changes to the database structure without affecting the capability to
DBMS to access the data we can say that structural independence has
been achieved.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

RELATIONAL MODEL
Disadvantages of Relational Model
Hardware Overheads: For hiding the complexities and making things
easier for the user this model requires more powerful hardware
computers and data storage devices.
Bad Design: As the relational model is very easy to design and use. So
the users don't need to know how the data is stored in order to access it.
This ease of design can lead to the development of a poor database
which would slow down if the database grows.

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory
FCAIT - MSc-(IT)

THANK YOU

Prepared by : Prof. Jenny Kasudiya Subject : Relational Database Management System - Theory

You might also like