Explain the three-schema architecture of a DBMS.
MediumConceptDBMS Fundamentals
Answer
The three-schema architecture (also called the ANSI/SPARC architecture) describes a database at three levels of abstraction, so that users do not need to know how the data is physically stored.
- Internal (physical) level: how data is actually stored on disk, such as file organisation, indexes and compression.
- Conceptual (logical) level: the whole database for the organisation, meaning the tables, columns, data types, relationships and constraints. Designers and administrators work here.
- External (view) level: the part of the database that one user or application sees, usually defined with views.
- Mappings between the levels translate a request at one level into the level below, and they are what make data independence possible.
Example: A university database:
- External: the accounts office sees
(roll, name, fee_due), while the student portal sees(roll, name, marks). - Conceptual: one table
students(roll, name, dept, marks, fee_due). - Internal: that table is stored as a B+ tree file ordered by
roll, with an extra index ondept.