DBMS : A database management system is a collection of interrelated data and a set of programs to access those data. The primary goal of a DBMS is to provide a way to store and retrieve database information that is both convenient and efficient.
Data Abstraction :
Database Management system should be efficient and simpler to use for the end user and for better efficiency designers have to use some complex data structures also, to represent data in the database. Now, to make the system simpler for the user, the system hides these complex information, and it is known as abstraction of data.
There are three levels of data abstraction :
Physical Level :
It is the lowest level of abstraction. It describes how the data is actually stored in the memory and complex low-level data structures in detail.
Logical Level (Conceptual Level) :
It describes what data are stored in the database and what relationship exists among those data. The users of logical level does not need to be aware of the complexity of physical-level structures, it is also known as physical data independence. Database administrators use the logical level of the abstraction to decide what information to keep in the database.
View Level (External Level) :
It is the highest level of abstraction. This level describes the user interaction with database system.
Let’s say we are creating a school database, in which we have student-data and teacher-data, tables. Then, at physical level these records can be described as blocks of storage in memory. These details are often hidden from the programmer.
At the logical level these records will be described as fields and attributes (student name, roll no etc.) along with their datatypes (int, char etc.) and their relationship among each other.
At view level, user just interact with system, with the help of GUI and enter the details at the screen, they are not aware of how the data is stored and what data is stored.
We have namely two levels of data independence arising from these levels of abstraction :
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 optimisation purposes, e.g., 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:
- Utilising new storage devices.
- Modifying data structures used for storage.
- Altering indexes or using alternative file organisation 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.