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

data abstraction

Data abstraction in DBMS involves hiding unnecessary details from users to simplify data access and enhance usability. It consists of three levels: Physical (how data is stored), Logical (what data is stored and its relationships), and View (user-specific data representation). The main goal is to achieve data independence, allowing changes in the database schema without affecting applications or user interactions.

Uploaded by

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

data abstraction

Data abstraction in DBMS involves hiding unnecessary details from users to simplify data access and enhance usability. It consists of three levels: Physical (how data is stored), Logical (what data is stored and its relationships), and View (user-specific data representation). The main goal is to achieve data independence, allowing changes in the database schema without affecting applications or user interactions.

Uploaded by

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

https://www.codingninjas.

com/studio/library/data-abstractions-in-dbms

What is Data Abstraction DBMS?


Data abstractions in DBMS refer to the hiding of unnecessary data from the
end-user. Database systems have complex Data Structures and relationships.
These difficulties are masked so that users may readily access the data, and
just the relevant section of the database is made accessible to them through
data abstraction. Let's understand this more with an example.
Example
Our dependency on email communication in the modern day is apparent.
However, data location and storage specifics are frequently hidden from us.
Regardless of their physical storage or data type, reading and managing our
emails is our top priority while using Gmail.
If we want to retrieve any email from Gmail, we don't know where that data is
physically kept, such as in India or the United States, or what data model was
utilized to store it. These things are not essential to us. Only our email is of
interest to us.

Levels of Data Abstraction in DBMS


Database Management Systems (DBMS) are essential to effectively managing
and organizing data in data management. Three interrelated levels of
abstraction, each performing a different function, make up the hierarchical
framework through which these systems operate.
There are three levels of abstraction for DBMS, which are as follows −
Physical or Internal Level
Logical or Conceptual Level
View or External Level
Now let's look at the levels of data abstractions in DBMS and discuss them in
detail.
1. Physical or Internal Level
It is the lowest level of abstraction for DBMSs, defining how data is stored, data
structures for storing data, and database access mechanisms.
Developers or database application programmers decide how to store data in
the database. It is complex to understand.
Example
The physical level, being the lowest level of abstraction, can be understood
with an example, like how information about a customer is stored in tables
while the data is stored in the form of blocks.
Another example of physical-level abstraction would be sequential file
organization due to the continuous storage of records. While in indexed file
organizations, we can access the records with the help of indexes.
2. Logical or Conceptual Level
The logical level is the next higher level or intermediate level. It explains what
data is stored in the database and how those data are related. It seeks to
explain the complete or entire data by describing what tables should be
constructed and what the linkages between those tables should be. It is less
complex than the physical level.
Example
The logical level in DBMS is used for representing entities and relationships
among the data stored. For example, defining tables and their attributes and
specifying relationships between them. A table named ‘class’ may have
different attributes like student_name, Roll_no, student ID, and Marks.
A table named ‘IDs’ contains details about the address of the teacher's ID
(foreign key), and student ID (foreign key).
3. View or External Level
This is the top level. There are various views at the view level, with each view
defining only a portion of the total data. It also facilitates user engagement by
providing a variety of views or numerous views of a single database. All users
have access to the view level. This is the easiest and most simple level.
Example
The external level in DBMS defines a part of the entire data and simplifies
interaction with the user by providing multiple views of a similar database. For
example, interacting with a system using a graphical user interface (GUI) to
access an application's features. Here GUI is the view level, and the user does
not know how and what data is exactly stored, i.e hiding the details from the
user.
Also read, File System vs DBMS
What is Data Independence?
The primary goal of data abstractions in DBMS is to obtain data independence in
order to save time and money when modifying or altering a database.
Data independence is known as the ability to change the scheme without
impacting the programmes and applications to be rewritten. Data is isolated
from programmes so that changes to the data do not influence the program's
or application's execution.
Data Independence is mainly of two types :
1. Physical level independence
It refers to the ability to change the physical schema without changing the
conceptual or logical schema, which is done for optimization purposes.
2. Logical level independence
This feature is referred to as the ability to change the logical schema without
changing the external schema or application program.
Any modifications to the conceptual representation of the data would not affect
the user's perception of the data.
Advantages of Data Abstraction in DBMS
It reduces the complexity for the users.

While retrieval of data abstractions in DBMS makes the system efficient.

Increases the usability of the users.

Increases the security aspect of the application as implementation details


are hidden from the users.

Increases the code duplicity and reusability.


Disadvantages of Data Abstraction in DBMS
Some of the disadvantages of data abstraction are mentioned below.
Data abstraction might b confusing for developers as there are
complexities at multiple levels of the database.
Whenever the extra layer is added to the code, navigation becomes
challenging.

At lower levels changing the behavior of DBMS might prove to be a


challenging task or might even be impossible because of abstraction.
Frequently Asked Questions
What are the 3 levels of data abstraction?
There are three levels of abstraction :
1.Physical Level: Defines how the data is actually stored employing various
data structures.

2.Logical level: Describes the relationship which exists among the stored
data.

3.View level: Provides a high-level view of a section of data.


What is data abstraction in DBMS example?
Data abstractions in DBMS refer to hiding unnecessary data from the end-user.
Example: If we want to retrieve any email from Gmail, we don't know where
that data is physically kept, such as in India or the United States, or what data
model was utilized to store it. These things are not essential to us. Only our
email is of interest to us.
Why is data abstraction important?
Data abstraction is crucial in DBMS because it shields users and applications
from the complexities of the underlying database structure. It provides a
simplified, high-level view of data, enhancing data security, privacy, and
reducing the risk of errors.
What is the main use of abstraction?
The main use of abstraction is to create a clear separation between what
something does and how it does it. It allows developers to work with high-level
concepts and models, making software design and development more efficient
and comprehensible.

https://www.prepbytes.com/blog/dbms/levels-of-abstraction-in-dbms/
Ques 1. What is data independence in DBMS?
Ans. Data independence in DBMS refers to the ability to make
changes to the physical storage and access methods without affecting
the external or conceptual levels.

Ques 3. What is a schema in DBMS?


Ans. A schema in DBMS is a description of the data that is relevant to
a specific user or application. The schema defines the tables,
attributes, and relationships that are relevant to the user or
application.

https://www.geeksforgeeks.org/data-abstraction-and-data-independence/
Data Abstraction and Data
Independence
Database systems comprise complex data structures. In order to make
the system efficient in terms of retrieval of data, and reduce complexity
in terms of usability of users, developers use abstraction i.e. hide
irrelevant details from the users. This approach simplifies database
design.
Level of Abstraction in a DBMS
There are mainly 3 levels of data abstraction:

Physical or Internal Level


Logical or Conceptual Level
View or External Level
Physical or Internal Level
This is the lowest level of data abstraction. It tells us how the data is
actually stored in memory. Access methods like sequential or random
access and file organization methods like B+ trees and hashing are used
for the same. Usability, size of memory, and the number of times the
records are factors that we need to know while designing the database.
Suppose we need to store the details of an employee. Blocks of storage
and the amount of memory used for these purposes are kept hidden from
the user.
Logical or Conceptual Level
This level comprises the information that is actually stored in the
database in the form of tables. It also stores the relationship among the
data entities in relatively simple structures. At this level, the information
available to the user at the view level is unknown.
We can store the various attributes of an employee and relationships,
e.g. with the manager can also be stored.

The logical level thus describes the entire database in terms of a small
number of relatively simple structures. Although implementation of the
simple structures at the logical level may involve complex physical-level
structures, the user of the logical level does not need to be aware of this
complexity. This is referred to as physical data independence. Database
administrators, who must decide what information to keep in the
database, use the logical level of abstraction.
View or External Level
This is the highest level of abstraction. Only a part of the actual database
is viewed by the users. This level exists to ease the accessibility of the
database by an individual user. Users view data in the form of rows and
columns. Tables and relations are used to store data. Multiple views of
the same database may exist. Users can just view the data and interact
with the database, storage and implementation details are hidden from
them. Even though the logical level uses simpler structures, complexity
remains because of the variety of information stored in a large database.
Many users of the database system do not need all this information;
instead, they need to access only a part of the database. The view level
of abstraction exists to simplify their interaction with the system
Example: In case of storing customer data,
Physical level – it will contains block of storages (bytes,GB,TB,etc)
Logical level – it will contain the fields and the attributes of data.
View level – it works with CLI or GUI access of database

Data Abstraction

The main purpose of data abstraction is to achieve data independence in


order to save the time and cost required when the database is modified
or altered.
Data Independence
Data Independence is mainly defined as a property of DBMS that helps
you to change the database schema at one level of a system without
requiring to change the schema at the next level. it helps to keep the
data separated from all program that makes use of it.
We have namely two levels of data independence arising from these
levels of abstraction:
Physical level data independence
Logical level data independence
Data Independence

Physical Level Data Independence

It refers to the characteristic of being able to modify the physical schema


without any alterations to the conceptual or logical schema, done for
optimization purposes, e.g., the Conceptual structure of
the database would not be affected by any change in storage size of the
database system server. Changing from sequential to random access
files is one such example. These alterations or modifications to the
physical structure may include:
Utilizing new storage devices.
Modifying data structures used for storage.
Altering indexes or using alternative file organization techniques etc.
Logical Level Data Independence
It refers characteristic of being able to modify the logical schema without
affecting the external schema or application program. The user view of
the data would not be affected by any changes to the conceptual view of
the data. These changes may include insertion or deletion of attributes,
altering table structures entities or relationships to the logical schema,
etc.

You might also like