Data Abstraction in DBMS

Challenge Inside! : Find out where you stand! Try quiz, solve problems & win rewards!

Learn via video courses

Overview

Data abstraction is the method of hiding the unimportant details that are present in the database from the end users to make the accessing of data easy and secure.

Scope

In this article on Data Abstraction, we will look at the following points:

  • What data abstraction is and how it is related to our daily lives.
  • The different layers of data abstraction in DBMS.

Introduction

Introduction to Data Abstraction in DBMS

Data abstraction is present in our daily lives. Let us take a small example. Say, someone, asks you to switch on the fans in a room. All you will need to do is simply walk to the switchboard and turn on the switch for the fan, that’s it! Do you need to know where the electricity is coming from, how the poles of the switch are connected, or exactly what the internal working of a fan is? The answer to all this is NO! That is what data abstraction is, all these background details are hidden from you inside the switchboard!

All the databases have complex data structures which are, in fact, of no use to an end user. Thus, these internal irrelevant details are hidden from the user, making the accessing of data simple and increasing the security of the data as well. This is what Data Abstraction is.

Levels of Data Abstraction in DBMS

The data abstraction in DBMS is implemented in 3 layers:

  • Physical or Internal Level
  • Logical or Conceptual Level
  • View or External Level

The following diagram will give you a clear view of how the implementation is done.

DBMS Levels of Data Abstraction

Starting from the very bottom, we have the physical or internal layer, then we have the middle layer, the logical or conceptual layer, and finally, we have the view or external layer.

Let us discuss each of these three layers in detail.

Physical Level or Internal Level

This is the layer of data abstraction where the raw data is physically stored as files. This layer contains all the complex data structures and the data accessing methods defined. The physical layer is the lowest level of data abstraction in a DBMS. It is the database administrator who decides how the data is to be stored in these physical hard drives.

Example:

When we access data we may get a single data or a table of data. Moreover, by the term "relational database" we visualize a table of rows and columns. But at a physical level, these tables are stored in hard drives which are located at a very secure data center.

Physical Level Data Abstraction

Above is the picture of a Google data center that can be visited by only 1% of Googlers! All these racks contain hard disk drives storing all your secured data!

Logical Level or Conceptual Level

After taking the raw data from the physical or internal level, the structure of the data is defined at the logical or conceptual level. This is like a blueprint of the raw data. This layer does not have any information about how the end user will view the data.

Example:

We have data of a few products like product id, product name, and manufacturing date, and we have another set of data of customers containing customer id, customer name, and customer address. Now, we need to frame this data in proper tables of products and customers. After that, we can even frame a join to show which product has been ordered by which customer.

View Level or External Level

This is what an end-user gets to see. He/she does not get the entire database, but depending on the queries made from the front-end the user gets to see the data. It may be a single data from the entire database or a collection of data in tabular format. Multiple views of the same data are available to the user, the representation can be a table, a graph, or a pie chart. View Level is the highest level of data abstraction in DBMS.

Example:

Concerning the example in the logical level section, let us say a customer wants to view the order history, he gets to see only the orders he had made in the past. Now, let us say a shop owner needs to see the products that are on the order list. He gets to see a table containing all the info about the products and the customers to whom they need to be delivered.

Conclusion

  • Data abstraction in DBMS means hiding unnecessary background details from the end user to make the accessing of data easy and secure.
  • In DBMS, there are 3 levels of data abstraction:
    • Physical Level or Internal Level: This is the layer where the raw data is stored in file format on physical hard drives.
    • Logical Level or Conceptual Level: In this layer, the raw data is taken from the physical layer and organized in a proper structure, like in tabular format.
    • View Level or External Level: At this level, the end users get the data depending on the queries. The same data can be viewed in multiple ways, like tables, graphs, or pie charts.

Read More: