Data abstraction in DBMS means hiding the complexity of data from the users. while creating the data developers can use complex data structures to represent the data in the database. since the users that are using these data are not aware of the complexity of the data. so the developers hide the complex part of the data in different levels so that the user can get the data in a simple form. and the hiding of data is called the data abstraction in DBMS.

Three levels of Data Abstraction

  1. Physical level
  2. Logical Level
  3. View level

Physical level

This is the lowest level of abstraction that describes how the data is actually stored. this level describes the complex part of data structure in detail.

Logical level

This is the higher level than the physical level that describes what data are stored in the database and the relationship among those data. it describes the database in a small number of relatively simple structures. although some complex physical level structures are present at this level users don't need to worry about that complexity part.

View level

This is the highest level of abstraction that describes the entire database. it may happen that all the users may not need all the information or data that present in the database. so this level defines some views so that the required view can be load on a request.

three levels of Data Abstraction in DBMS
three levels of data abstraction


For example, we have described a record as follows

type instructor = record
ID : char (5);
name : char (20);
dept name : char (20);
salary : numeric (8,2);
end;

we have defined a new record of a type called instructor with four fields and each field has a name and a type associated with it. we can also define some more records types like

  • department record with fields dept_name, building, and budget
  • course record with fields course_id, title, dept_name, and credits
  • student record with fields ID, name, dept_name, and tot_cred

At the physical level, the records can be described as a block of consecutive storage locations just like we define instructor, department, or student records.

At the logical level, each record is described by the type definition, just like in the above code we define the interrelationship of these records.

At the view level, several views of the database are defined and a user can see some or all of these views. and at this point views also provide a security mechanism to prevent users from accessing certain parts of the database.

Instances and schemas in DBMS

The collection of information stored in the database at a particular time is called an instance of the database and the overall design of the database is called the database schema.

Whenever the information is inserted and deleted the database change with changes. also the schemas of the database change infrequently. we can understand the schemas and instances of the database by analogy to a program written in a programming language.

A database schema corresponds to the variable declarations with the associated type definitions in a program. each variable has its particular value at a given instant. and the value of the variable in a program corresponds to an instance of a database schema.

Database systems have many schemas, that are partitioned according to the abstraction levels. the physical schema describes the database design at the physical level and the logical schema describes the database design at the logical level. a database may also have several schemas at the view level, called subschemas that describe the different views of the database.

programmers use logical schema to construct the applications. the physical schema is hidden at the logical schema and can usually be hanged easily without affecting application programs.