What is data independence? Explain physical and logical data independence.
MediumConceptDBMS Fundamentals
Answer
Data independence is the ability to change the schema at one level of a database without changing the schema at the next higher level or the application programs. It is made possible by the mappings of the three-schema architecture.
- Physical data independence: the internal level can change without affecting the conceptual level, for example adding an index, moving files to a faster disk or changing the storage structure.
- Logical data independence: the conceptual level can change without affecting external views and applications, for example adding a column or splitting a table.
- Logical independence is harder to achieve, because applications depend directly on table and column names.
Example: The query SELECT name FROM students WHERE roll = 7; keeps working unchanged after the administrator adds an index on roll; it simply runs faster (physical independence). If students is later split into student_info and student_contacts, a view named students that joins the two tables lets old reports run without changes (logical independence).