THREE SCHEMA
ARCHITECTURE AND
DATA INDEPENDENCE
Author : POONAM SHARMA
Schemas versus Instances
• Database Schema: The description of a
database. Includes descriptions of the database
structure and the constraints that should hold on
the database.
• Schema Diagram: A diagrammatic display of
(some aspects of) a database schema.
• Schema Construct: A component of the schema
or an object within the schema, e.g., STUDENT,
COURSE.
• Database Instance: The actual data stored in a
database at a particular moment in time. Also
called database state (or occurrence).
Database Schema Vs. Database
State
• Database State: Refers to the content of a
database at a moment in time.
• Initial Database State: Refers to the database
when it is loaded
• Valid State: A state that satisfies the structure
and constraints of the database.
• Distinction
• The database schema changes very infrequently. The
database state changes every time the database is
updated.
• Schema is also called intension, whereas state is
called extension.
Example of a Database
Schema
Example of a database
state
Objectives of Three-Schema
Architecture
Proposed to support DBMS
characteristics of:
◦ Program-data independence.
◦ Support of multiple views of the data.
All users should be able to access same data.
A user’s view remains unaffected to changes made in other
views.
Users should not need to know physical storage details.
Objectives of Three-Schema
Architecture
1. DBA should be able to change database storage
structures without affecting the user’s views.
2. logical structure of database should be unaffected by
changes to physical aspects of storage.
3. DBA should be able to change conceptual structure of
database without affecting all users.
A three-level architecture
◦ Internal level: For systems designers
◦ Conceptual level: For database designers and
administrators
◦ External level: For database users
The three-schema
architecture
Three-Schema
Architecture(Cont..)
Defines DBMS schemas at three levels:
◦ Internal schema at the internal level to describe physical
storage structures and access paths (e.g indexes).
Typically uses a physical data model.
◦ Conceptual schema at the conceptual level to describe the
structure and constraints for the whole database for a
community of users.
Uses a conceptual or an implementation data model.
◦ External schemas at the external level to describe the
various user views.
Usually uses the same data model as the conceptual schema.
Data Independence
Logical Data Independence:
◦ The capacity to change the conceptual schema
without having to change the external schemas and
their associated application programs.
Physical Data Independence:
◦ The capacity to change the internal schema without
having to change the conceptual schema.
◦ For example, the internal schema may be changed
when certain file structures are reorganized or new
indexes are created to improve database
performance
Data Independence (Cont..)
When a schema at a lower level is changed, only the
mappings between this schema and higher-level
schemas need to be changed in a DBMS that fully
supports data independence.
The higher-level schemas themselves are unchanged.
◦ Hence, the application programs need not be changed
since they refer to the external schemas.
Mappings
Mappings translate information from one
level to the next
◦ External/Conceptual
◦ Conceptual/Internal
These mappings provide data independence