Data independence is a property of a database management system (DBMS) that allows us to change the schema at one level of DBMS without affecting the schema at the next higher level. This allows us to keep the data and programs separate.
We can use the three-schema architecture to implement data independence properties, as shown below:
There are two types of data independence:
Schema is defined at three different levels in this architecture:
It is the part of the database that the user is specifically interested in. Different views are made at this level for the user. For instance, a user can view course details and section details simultaneously without worrying about the exact process running at the back end.
The database structure is defined at this level for a community of users. The structure explains this level's data types, entities, and relationships. However, the user keeps intricate details hidden, such as the physical storage structure.
This stage defines how the data is physically stored on the storage devices, such as a hard disk. Complete details of physical storage and access paths are provided.
Logical data independence is primarily concerned with the structure or changing the data definition and the logical schema. Any changes that can be made at this level to the database are listed as follows:
We can perform the functions above without modifying any existing application program.
DBMS uses a modified external to logical layer mapping to preserve the property of logical data independence. The mapping is automatically performed by DBMS itself. It absorbs the changes made to the logical layer.
Note: Changes must be made to the application program if new fields are added or deleted from the database.