0% found this document useful (0 votes)
27 views19 pages

Unit One - DBMS

Unit one DBMS NOTES to help in the exam point of you

Uploaded by

yashlanjewar370
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)
27 views19 pages

Unit One - DBMS

Unit one DBMS NOTES to help in the exam point of you

Uploaded by

yashlanjewar370
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/ 19

UNIT ONE

Introduction to DBMS:
A Database Management System (DBMS) is a software system that is designed to manage and
organize data in a structured manner. It allows users to create, modify, and query a database, as
well as manage the security and access controls for that database.
DBMS provides an environment to store and retrieve the data in convenient and efficient
manner.
Key Features of DBMS:
● Data modeling: A DBMS provides tools for creating and modifying data models, which
define the structure and relationships of the data in a database.
● Data storage and retrieval: A DBMS is responsible for storing and retrieving data from
the database, and can provide various methods for searching and querying the data.
● Concurrency control: A DBMS provides mechanisms for controlling concurrent access to
the database, to ensure that multiple users can access the data without conflicting with each
other.
● Data integrity and security: A DBMS provides tools for enforcing data integrity and
security constraints, such as constraints on the values of data and access controls that
restrict who can access the data.
● Backup and recovery: A DBMS provides mechanisms for backing up and recovering the
data in the event of a system failure.
● DBMS can be classified into two types: Relational Database Management System
(RDBMS) and Non-Relational Database Management System (NoSQL or Non-SQL)
● RDBMS: Data is organized in the form of tables and each table has a set of rows and
columns. The data are related to each other through primary and foreign keys.
● NoSQL: Data is organized in the form of key-value pairs, documents, graphs, or column-
based. These are designed to handle large-scale, high-performance scenarios.
A database is a collection of interrelated data which helps in the efficient retrieval, insertion, and
deletion of data from the database and organizes the data in the form of tables, views, schemas,
reports, etc. For Example, a university database organizes the data about students, faculty, admin
staff, etc. which helps in the efficient retrieval, insertion, and deletion of data from it.

Definition of DBMS:

i. Database Management Systems (DBMS) are software systems used to store, retrieve, and run
queries on data. A DBMS serves as an interface between an end-user and a database,
allowing users to create, read, update, and delete data in the database.
ii. DBMS – is a computerized solution that helps store information in a manner that is easy to
read, edit, delete, and scale, with the primary objective of drawing correlations, powering
analysis, and supporting data-driven workflows. It has a backend storage system as well as a
front-end user interface.
Traditional File System

File system is collection of data. In this system, user has to write procedures for
managing database. It provides details of data representation and storage of data. In this –
● Data is stored in files.
● Each file has specific format.
● Programs that use these files depend on knowledge about that format.
● In earlier days, database applications were built on top of file systems.
This approach is mostly obsolete but –
● Understanding problems inherent in file based systems may prevent us from repeating
these problems in our database system.
● Understanding how file system works is extremely useful when converting a file-based
system to a database system.
Basically, it is a collection of application programs that performs services for end users such
as production of reports. Each file defines and manages its own data.
It doesn’t have a crash mechanism i.e., if system crashes while entering some data, then
content of file will be lost. This is disadvantage of traditional file based system. Also, it is
very difficult to protect a file under the file system. This system can’t efficiently store and
retrieve data.
Advantages of Traditional File System :
● File processing cost less and can be more speed than database.
● File processing design approach was well suited to mainframe hardware and batch input.
● Companies mainly use file processing to handle large volumes of structured data on a
regular basis.
● It can be more efficient and cost less than DBMS in certain situations.
● Design is simple.
● Customization is easy and efficient.
Disadvantages of Traditional File System :
● Data redundancy and inconsistency.
● Difficulty in accessing data.
● Data isolation – multiple files and formats.
● Integrity problems
● Unauthorized access is not restricted.
● It co-ordinates only physical access.
File System V/S DBMS
Basis DBMS Approach File System Approach

Meaning DBMS is a collection of data. In The file system is a collection of


DBMS, the user is not required to data. In this system, the user has to
write the procedures. write the procedures for managing
the database.

Sharing of data Due to the centralized approach, data Data is distributed in many files,
sharing is easy. and it may be of different formats,
so it isn't easy to share data.

Data Abstraction DBMS gives an abstract view of data The file system provides the detail
that hides the details. of the data representation and
storage of data.

Security and DBMS provides a good protection It isn't easy to protect a file under
Protection mechanism. the file system.

Recovery DBMS provides a crash recovery The file system doesn't have a
Mechanism mechanism, i.e., DBMS protects the crash mechanism, i.e., if the system
user from system failure. crashes while entering some data,
then the content of the file will be
lost.

Manipulation DBMS contains a wide variety of The file system can't efficiently
Techniques sophisticated techniques to store and store and retrieve the data.
retrieve the data.

Concurrency DBMS takes care of Concurrent In the File system, concurrent


Problems access of data using some form of access has many problems like
locking. redirecting the file while deleting
some information or updating
some information.

Where to use Database approach used in large File system approach used in large
systems which interrelate many files. systems which interrelate many
files.

Cost The database system is expensive to The file system approach is


design. cheaper to design.

Data Redundancy Due to the centralization of the In this, the files and application
and Inconsistency database, the problems of data programs are created by different
redundancy and inconsistency are programmers so that there exists a
controlled. lot of duplication of data which
may lead to inconsistency.

Structure The database structure is complex to The file system approach has a
design. simple structure.
Data In this system, Data Independence In the File system approach, there
Independence exists, and it can be of two types. exists no Data Independence.
o Logical Data Independence
o Physical Data Independence

Integrity Integrity Constraints are easy to Integrity Constraints are difficult to


Constraints apply. implement in file system.

Data Models In the database approach, 3 types of In the file system approach, there is
data models exist: no concept of data models exists.
o Hierarchal data models
o Network data models
o Relational data models

Flexibility Changes are often a necessity to the The flexibility of the system is less
content of the data stored in any as compared to the DBMS
system, and these changes are more approach.
easily with a database approach.

Examples Oracle, SQL Server, Sybase etc. Cobol, C++ etc.

Objectives Of DBMS
DBMS has many objectives to increase the efficiency and organized handling of data in an
organization. The main objectives of DBMS are –

Data Availability:
DBMS ensures that the format of data should be meaningful and at a reasonable cost so that
a wide range of users can access it.

Data Organization and Structuring:


DBMS structures and efficiently organize the data to eliminate data complexity and provide
a framework for relationships between different data entities.

Data Integrity and Consistency:


DBMS uses integrity constraints like primary keys, and foreign keys to maintain the
integrity and accuracy of data.
Data Security and Authorization:
To maintain the authority of data and protect it from unauthorized access, DBMS validates
the user and gives permissions to only authorized users to view, modify, and delete.

Data Independence:
DBMS allows easier modification of databases without affecting the applications.

Three Level Architecture of DBMS:

The 3-level architecture is a commonly used architectural approach in Database


Management Systems (DBMSs) for the design and development of applications that work
with databases. The 3-level architecture divides an application’s components into three tiers
or layers. Each layer has its own set of responsibilities.
DBMS 3-level architecture divides the complete system into three inter-related but
independent modules as shown below:

● Physical Level: At the physical level, the information about the location of database
objects in the data store is kept. Various users of DBMS are unaware of the locations of
these objects. In simple terms, physical level of a database describes how the data is
being stored in secondary storage devices like disks and tapes and also gives insights on
additional storage details.
● Conceptual Level: At conceptual level, data is represented in the form of various
database tables. For Example, STUDENT database may contain STUDENT and
COURSE tables which will be visible to users but users are unaware of their storage.
Also referred as logical schema, it describes what kind of data is to be stored in the
database.
● External Level: An external level specifies a view of the data in terms of conceptual
level tables. Each external level view is used to cater to the needs of a particular
category of users. For Example, FACULTY of a university is interested in looking
course details of student, STUDENTS are interested in looking at all details related to
academics, accounts, courses and hostel details as well. So, different views can be
generated for different users. The main focus of external level is data abstraction.

Data Independence
Data independence means a change of data at one level should not affect another level. Two
types of data independence are present in this architecture:
● Physical Data Independence: Any change in the physical location of tables and indexes
should not affect the conceptual level or external view of data. This data independence is
easy to achieve and implemented by most of the DBMS.
● Conceptual Data Independence: The data at conceptual level schema and external
level schema must be independent. This means a change in conceptual schema should
not affect external schema. e.g.; Adding or deleting attributes of a table should not affect
the user’s view of the table. But this type of independence is difficult to achieve as
compared to physical data independence because the changes in conceptual schema are
reflected in the user’s view.

Component of DBMS:

Hardware, Software, Data, Database Access Language, Procedures and Users all together
form the components of a DBMS.
Let us discuss the components one by one clearly.
Hardware
The hardware is the actual computer system used for keeping and accessing the database.
The conventional DBMS hardware consists of secondary storage devices such as hard disks.
Databases run on the range of machines from micro computers to mainframes.
Software
Software is the actual DBMS between the physical database and the users of the system. All
the requests from the user for accessing the database are handled by DBMS.
Data
It is an important component of the database management system. The main task of DBMS
is to process the data. Databases are used to store the data, retrieved, and updated to and
from the databases.
Users
There are a number of users who can access or retrieve the data on demand using the
application and the interfaces provided by the DBMS.
The users of the database can be classified into different groups −
● Native Users
● Online Users
● Sophisticated Users
● Specialized Users
● Application Users
● DBA- Database Administrator

The components of DBMS are given below in pictorial form –

What is a database administrator (DBA)

A database administrator (DBA) is the information technician responsible for directing and
performing all activities related to maintaining and securing a
successful database environment. A DBA ensures an organization's databases and related
applications operate functionally and efficiently.

DBAs frequently design and develop new features and debug issues, while working
alongside a diverse group of individuals such as developers, data architects and business
stakeholders. Therefore, they're expected to be proficient in both technical and business
skills.

What are the roles and responsibilities of a DBA?

A DBA assumes many different roles and responsibilities within the IT department
involving database systems and applications.

The roles and responsibilities of a DBA typically include the following:

● Database deployment and management. The DBA keeps databases and


applications running up to performance, availability and recoverability standards
while handling additional functions. When adopting a new DBMS, the DBA is
responsible for designing, setting up and maintaining the database system. Often that
includes installing the DBMS and setting up the IT infrastructure to enable
applications to access databases. For a cloud database implementation, the DBA isn't
responsible for installation but must orchestrate the proper configuration, access and
deployment options for their organization's use of the cloud database.

● Documentation and training. The DBA must also establish policies and procedures
pertaining to the management, security, maintenance and use of the database
management system. The DBA group creates training materials and instructs
employees and developers on the proper access and usage of the DBMS.

● Troubleshooting. When problems arise, the DBA is the focal point for resolution,
including troubleshooting, root cause analysis, fine tuning and optimizing the
performance of tasks and programs that access the database. The DBA must be
capable of performing root cause analysis -- identifying the cause of the problem so it
can be resolved. This task requires the ability to locate bottlenecks and points of
contention, monitor workload and throughput, review SQL performance and
optimization, monitor storage space and fragmentation and view and manage the
system and DBMS resource use.

● Backup and disaster recovery. The DBA is responsible for ensuring that databases
and data are backed up appropriately and can be recovered correctly and quickly in
the event of failure. The DBA also ensures that databases are protected and secured,
enacts measures to maintain the database integrity in terms of data accuracy and
makes sure unauthorized users can't access the data.

● Collaboration and integration. The DBA frequently gets pulled into other projects
as a subject matter expert on the database. Because databases are at the center of most
modern application development projects, the DBA participates in database
integration and use in a variety of IT projects. This exposure to many different
technologies and experiences can make the DBA a valuable IT technician not just for
database-related issues, but for other technologies as well.

● Efficient database design. Database administrators work with application


developers to ensure accurate and efficient application design for database access.
DBA tasks include interfacing SQL with traditional programming languages,
selecting the type of SQL to use, using middleware and APIs such as REST, Open
Database Connectivity, Java Database Connectivity and SQLJ effectively, defining
transactions and determining the appropriate use of frameworks such as Java
Enterprise Edition and .NET. DBAs might also be asked to modify or write
application code to help development projects.

● Optimizing database performance. Database performance is the optimization of


resource usage to increase throughput and minimize contention, enabling the largest
possible workload to be processed. Ensuring efficient performance of the database
and applications that access it is a core function of database administration.

● Staying current. As the central point of contact for information about the company's
database management systems, DBAs must keep up to date on the latest versions and
capabilities of each DBMS.

● Using the right tools. Administering a DBMS usually requires the use of other tools
than those provided with the DBMS. DBAs must understand the strengths and
weaknesses of native DBA tools, develop a strategy for addressing the weaknesses
and use tools that improve the performance, availability, administration and recovery
of the databases they manage.

● User access and support. A DBA creates new user accounts and provides access
permissions. They also create and manage database reports, visualizations and
dashboards to help users easily understand the status of their database.

● Communication. DBAs must have good communication skills. They must be able to
converse and work with application programmers, business end users, IT and
business managers, data analysts and other DBAs.

What are the different types of DBAs?


Many different types of DBAs exist, the most common type being the general-purpose
DBA, who performs all types of administrative and data-related work. However, it isn't
uncommon for DBAs to focus on specific problem domains. A DBA, for example, might
focus entirely on database design, perhaps broken into logical design and physical design;
specialize in building systems; concentrate on maintaining and tuning existing systems; or
center their attention on narrow areas of database management and administration.
Within larger organizations, DBA responsibilities typically are split into separate types of
roles. Beyond general-purpose, the primary roles include system DBA, database architect,
database analyst, application DBA, task-oriented DBA, performance analyst, data
warehouse administrator and cloud DBA.

System DBA

This role focuses on technical, rather than business, issues. The system DBA is
knowledgeable in the arcane technical details of how the database is installed, configured
and modified. Typical tasks center on the physical installation and performance of the
DBMS software and can include the following:
● Installing new software versions and applying fixes.

● Setting and tuning system parameters.

● Tuning the operating system, network and transaction processors to work with the
DBMS.
● Ensuring appropriate storage and memory are available for the DBMS.
System DBAs are rarely involved with the actual database and application set up. They
might get involved in application tuning when operating system parameters or complex
DBMS parameters need to be altered.

Database architect

The primary responsibility of this role is the design and set up of new databases. The
database architect designs new databases and database structures for new and existing
applications and is rarely involved in the maintenance and tuning of established databases
and applications. Typical tasks include the following:
● Modelling logical data.

● Translating logical data models into a physical database design.

● Analysing data access requirements to ensure optimal database design and efficient
SQL access.
● Creating backup and recovery strategies for new databases.
Database analyst

Sometimes junior DBAs are referred to as database analysts. The database analyst's role
might be like that of the database architect. The database analyst designation can be another
name for a database administrator.

Application DBA

An application DBA focuses on database design and the ongoing database support and
administration for a specific application or subset of applications. The application DBA is
likely an expert in writing and debugging complex SQL. They understand the best ways to
incorporate database requests into application programs. Application DBAs typically are
also responsible for managing and refreshing test data for application development teams.

Not every organization has an application DBA on staff. In that case, the general-purpose
DBA supports specific applications while also maintaining the organization's database
environment. But even with an application DBA on board, general-purpose DBAs are still
required to support the overall database environment and infrastructure.

Task-oriented DBA

This specialized DBA focuses on a specific administrative task and is uncommon outside of
large IT shops. A backup and recovery DBA, for example, would be task-oriented to ensure
the organization's databases are recoverable, including creating backup plans, building and
testing backup scripts, testing recovery scripts, and driving recovery tasks when required.
The backup and recovery DBA also participates in building and testing disaster contingency
plans for the company's databases.
Performance analyst

As the most common task-oriented DBA, the performance analyst focuses entirely on
monitoring databases and improving the performance of applications that access them. A
performance analyst is an expert in SQL coding for performance and is knowledgeable in
designing and building high-performance databases. Performance analysts should have a
deep understanding of the DBMS, collaborate with other DBAs to execute changes when
required and communicate with application developers in their language to facilitate
appropriate program changes for performance.

Data warehouse administrator

This fully capable DBA has the knowledge and skills to monitor and support the data
warehouse environment. Data warehouse administrators understand the differences between
a database that supports online transaction processing and a data warehouse and must have
experience in the following areas:
● Business intelligence and query tools.

● Specialized database design for data warehousing.

● ETL skills.

● Knowledge of data warehousing technologies, such as online analytical


processing and star schema.
Cloud DBA

As companies increasingly migrate workloads to the cloud, the cloud DBA has become
more popular and performs many of the same tasks as a general-purpose DBA but for cloud
database executions on services like Amazon Web Services and Microsoft Azure. The cloud
DBA understands the services the cloud provider offers, including backup and security, to
set up databases in the cloud. Cloud DBAs need to be aware of latency, fault tolerance and
especially cost management because adding data or workloads to a cloud setup can
significantly increase costs.

Data modelers

Although an efficient database design must include data modelling, this isn't always
considered the job of a DBA, since they're more focused on technology than the business.
However, DBAs should know the essentials of data modelling, including how to build and
manage data models to illustrate the relationships between data components.

Data modelers create the data models and computer databases needed to transform intricate
organizational data into functional computer systems. They also oversee the information
flow across different departments within a business using relational, dimensional
and NoSQL databases.
Different Types of Database Users

A Database User is defined as a person who interacts with data daily, updating, reading, and
modifying the given data. Database users can access and retrieve data from the database
through the Database Management System (DBMS) applications and interfaces.

Types of Database Users

Database users are categorized based on their interaction with the database. There are seven
types of database users in DBMS. Below mentioned are the types of database users:

1. Database Administrator (DBA)


A Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of the database. The DBA will then create a new account ID and
password for the user if he/she needs to access the database. DBA is also responsible for
providing security to the database and he allows only authorized users to access/modify the
database. DBA is responsible for problems such as security breaches and poor system
response time.
● DBA also monitors the recovery and backup and provides technical support.

● The DBA has a DBA account in the DBMS which is called a system or superuser
account.
● DBA repairs damage caused due to hardware and/or software failures.

● DBA is the one having privileges to perform DCL (Data Control


Language) operations such as GRANT and REVOKE, to allow/restrict a particular
user from accessing the database.

2. Naive / Parametric End Users


Parametric End Users are the unsophisticated who don’t have any DBMS knowledge but
they frequently use the database applications in their daily life to get the desired results. For
example, Railway’s ticket booking users are naive users. Clerks in any bank is a naive user
because they don’t have any DBMS knowledge but they still use the database and perform
their given task.

3. A System Analyst
A system Analyst is a user who analyses the requirements of parametric end users. They
check whether all the requirements of end users are satisfied.

4. Sophisticated Users
Sophisticated users can be engineers, scientists, business analyst, who are familiar with the
database. They can develop their own database applications according to their requirement.
They don’t write the program code but they interact the database by writing SQL queries
directly through the query processor.

5. Database Designers
Data Base Designers are the users who design the structure of database which includes
tables, indexes, views, triggers, stored procedures and constraints which are usually
enforced before the database is created or populated with data. He/she controls what data
must be stored and how the data items to be related. It is the responsibility of Database
Designers to understand the requirements of different user groups and then create a design
which satisfies the need of all the user groups.

6. Application Programmers
Application Programmers also referred as System Analysts or simply Software Engineers,
are the back-end programmers who writes the code for the application programs. They are
the computer professionals. These programs could be written in Programming languages
such as Visual Basic, Developer, C, FORTRAN, COBOL etc. Application programmers
design, debug, test, and maintain set of programs called “canned transactions” for the Naive
(parametric) users in order to interact with database.

7. Casual Users / Temporary Users


Casual Users are the users who occasionally use/access the database but each time when
they access the database they require the new information, for example, Middle or higher
level manager.

8. Specialized users
Specialized users are sophisticated users who write specialized database application that
does not fit into the traditional data-processing framework. Among these applications are
computer aided-design systems, knowledge-base and expert systems etc.

Data Models in DBMS

A Data Model in Database Management System (DBMS) is the concept of tools that are
developed to summarize the description of the database. Data Models provide us with a
transparent picture of data which helps us in creating an actual database. It shows us from
the design of the data to its proper implementation of data.

Types of Relational Models

1. Conceptual Data Model

2. Representational Data Model

3. Physical Data Model


It is basically classified into 3 types:-

1. Conceptual Data Model

The conceptual data model describes the database at a very high level and is useful to
understand the needs or requirements of the database. It is this model, that is used in the
requirement-gathering process i.e. before the Database Designers start making a particular
database. One such popular model is the entity/relationship model (ER model). The E/R
model specializes in entities, relationships, and even attributes that are used by database
designers. In terms of this concept, a discussion can be made even with non-computer
science(non-technical) users and stakeholders, and their requirements can be understood.
Entity-Relationship Model (ER Model): It is a high-level data model which is used to
define the data and the relationships between them. It is basically a conceptual design of
any database which is easy to design the view of data.
Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name, place, object,
class, etc. These are represented by a rectangle in an ER Diagram.
2. Attributes: An attribute can be defined as the description of the entity. These are
represented by Ellipse in an ER Diagram. It can be Age, Roll Number, or Marks for a
Student.
3. Relationship: Relationships are used to define relations among different entities.
Diamonds and Rhombus are used to show Relationships.
Characteristics of a conceptual data model
● Offers Organization-wide coverage of the business concepts.

● This type of Data Models are designed and developed for a business audience.

● The conceptual model is developed independently of hardware specifications like


data storage capacity, location or software specifications like DBMS vendor and
technology. The focus is to represent data as a user will see it in the “real world.”
Conceptual data models known as Domain models create a common vocabulary for all
stakeholders by establishing basic concepts and scope
2. Representational Data Model
This type of data model is used to represent only the logical part of the database and does
not represent the physical structure of the database. The representational data model allows
us to focus primarily, on the design part of the database. A popular representational model
is a Relational model. The relational Model consists of Relational Algebra and Relational
Calculus. In the Relational Model, we basically use tables to represent our data and the
relationships between them. It is a theoretical concept whose practical implementation is
done in Physical Data Model. The advantage of using a Representational data model is to
provide a foundation to form the base for the Physical model

3. Physical Data Model


The physical Data Model is used to practically implement Relational Data Model.
Ultimately, all data in a database is stored physically on a secondary storage device such as
discs and tapes. This is stored in the form of files, records, and certain other data structures.
It has all the information on the format in which the files are present and the structure of the
databases, the presence of external data structures, and their relation to each other. Here, we
basically save tables in memory so they can be accessed efficiently. In order to come up
with a good physical model, we have to work on the relational model in a better
way. Structured Query Language (SQL) is used to practically implement Relational
Algebra.
This Data Model describes HOW the system will be implemented using a specific DBMS
system. This model is typically created by DBA and developers. The purpose is actual
implementation of the database.
Characteristics of a physical data model:
● The physical data model describes data need for a single project or application
though it may be integrated with other physical data models based on project scope.
● Data Model contains relationships between tables that which addresses cardinality
and nullability of the relationships.
● Developed for a specific version of a DBMS, location, data storage or technology to
be used in the project.
● Columns should have exact datatypes, lengths assigned and default values.

● Primary and Foreign keys, views, indexes, access profiles, and authorizations, etc. are
defined

Some Other Data Models


1. Hierarchical Model
The hierarchical Model is one of the oldest models in the data model which was developed
by IBM, in the 1950s. In a hierarchical model, data are viewed as a collection of tables, or
we can say segments that form a hierarchical relation. In this, the data is organized into a
tree-like structure where each record consists of one parent record and many children. Even
if the segments are connected as a chain-like structure by logical associations, then the
instant structure can be a fan structure with multiple branches. We call the illogical
associations as directional associations.

2. Network Model
The Network Model was formalized by the Database Task group in the 1960s. This model
is the generalization of the hierarchical model. This model can consist of multiple parent
segments and these segments are grouped as levels but there exists a logical association
between the segments belonging to any level. Mostly, there exists a many-to-many logical
association between any of the two segments.

3. Object-Oriented Data Model


In the Object-Oriented Data Model, data and their relationships are contained in a single
structure which is referred to as an object in this data model. In this, real-world problems
are represented as objects with different attributes. All objects have multiple relationships
between them. Basically, it is a combination of Object Oriented programming and a
Relational Database Model.

4. Float Data Model


The float data model basically consists of a two-dimensional array of data models that do
not contain any duplicate elements in the array. This data model has one drawback it cannot
store a large amount of data that is the tables can not be of large size.

5. Context Data Model


The Context data model is simply a data model which consists of more than one data model.
For example, the Context data model consists of ER Model, Object-Oriented Data Model,
etc. This model allows users to do more than one thing which each individual data model
can do.

6. Semi-Structured Data Model


Semi-Structured data models deal with the data in a flexible way. Some entities may have
extra attributes and some entities may have some missing attributes. Basically, you can
represent data here in a flexible way.
Advantages of Data Models
1. Data Models help us in representing data accurately.
2. It helps us in finding the missing data and also in minimizing Data Redundancy.
3. Data Model provides data security in a better way.
4. The data model should be detailed enough to be used for building the physical
database.
5. The information in the data model can be used for defining the relationship between
tables, primary and foreign keys, and stored procedures.
Disadvantages of Data Models
1. In the case of a vast database, sometimes it becomes difficult to understand the data
model.
2. You must have the proper knowledge of SQL to use physical models.
3. Even smaller change made in structure require modification in the entire application.
4. There is no set data manipulation language in DBMS.
5. To develop Data model one should know physical data stored characteristics.

1. Hierarchical Data Model:


Hierarchical data model is the oldest type of the data model. It was developed by IBM in
1968. It organizes data in the tree-like structure. Hierarchical model consists of the
following :
● It contains nodes which are connected by branches.

● The topmost node is called the root node.

● If there are multiple nodes appear at the top level, then these can be called as root
segments.
● Each node has exactly one parent.

● One parent may have many child.

2. Network Data Model:


It is the advance version of the hierarchical data model. To organize data it uses directed
graphs instead of the tree-structure. In this child can have more than one parent. It uses the
concept of the two data structures i.e. Records and Sets.
In the above figure, Project is the root node which has two children i.e. Project 1 and
Project 2. Project 1 has 3 children and Project 2 has 2 children. Total there are 5 children
i.e. Department A, Department B and Department C, they are network related children as
we said that this model can have more than one parent. So, for the Department B and
Department C have two parents i.e. Project 1 and Project 2.

Difference between Hierarchical Data Model and Network Data Model :

S.
No. Hierarchical Data Model Network Data Model

In this model, you could create a network


In this model, to store data hierarchy
1. that shows how data is related to each
method is used.
other.

It implements 1:1, 1:n and also many to


2. It implements 1:1 and 1:n relations.
many relations.

To organize records, it uses tree


3. To organize records, it uses graphs.
structure.

Records are linked with the help of Records are linked with the help of linked
4.
pointers. list.

Insertion anomaly exits in this model


5. i.e. child node cannot be inserted There is no insertion anomaly.
without the parent node.
S.
No. Hierarchical Data Model Network Data Model

Deletion anomaly exists in this model


6. i.e. it is difficult to delete the parent There is no deletion anomaly.
node.

It is used to access the data which is It is used to access the data which is
7.
complex and asymmetric. complex and symmetric.

When update operation is performed, it


No such problem exists because of the
suffers from inconsistency problem
8. single occurrence of records while
because of the existence of multiple
updating.
instances of child records.

There is partial data independence in this


9. This model lacks data independence.
model.

Less flexible in comparison to the


10. It is flexible.
relational model.

When you are searching for a record Searching for a record is easy because of
11. then firstly you need to visit parent the availability of multiple access paths to
record before retrieving a child record. reach data item.

Example- IBM’s IMS (Information


Example- Oracle. SQL Server, Sybase
12. Management System) implement this
DBMS implement this model.
model.

You might also like