DB Lec 04
DB Lec 04
Database Systems
Database Management S
ystems
Database Management S
ystems
Three-Schema Architecture
• Proposed to support DBMS characteristics of:
• Program-data independence.
• Support of multiple views of the data.
• Use of a catalog to store the database description
4
Database Management S
ystems
Database Management S
ystems
Three-Schema Architecture
• Goal is to separate the user application and the
physical database:
• Internal schema
• Conceptual schema
• External schemas
6
Database Management S
ystems
Internal schema
• Internal schema at the internal level to
describe physical storage structures and access
paths. Typically uses a physical data model and
describes the complete detail of the data
storage.
7
Database Management S
ystems
Conceptual schema
• 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
which hides the details of physical storage
structures and concentrates on describing
entities, data types, relationships, user
operations, and constraints i.e. representational
model
8
Database Management S
ystems
External schema
• External schemas at the external or view level
to describe the various user views. Usually uses
the same data model as the conceptual level.
Describes the part of the database that a
particular user group is interested in and hides
the rest of the database from that user group.
9
Database Management S
ystems
Three-Schema Architecture
• three schemas are only descriptions of data; the only data that
actually exists is at the physical level.
Database Management S
ystems
Three-Schema Architecture
Mappings among schema levels are needed to
transform requests and data. Programs refer to an
external schema, and are mapped by the DBMS to
the internal schema for execution.
• These mappings may be time-consuming, so some
DBMSs-especially those that are meant to support
small databases-do not support external views.
Even in such systems, however, a certain amount
of mapping is necessary to transform requests
between the conceptual and internal levels.
12
Database Management S
ystems
Data Independence
• Defined as capacity to change the schema at one
level of a database system without having to
change the schema at the next higher level.
• We can define two types of Data independence:
Database Management S
ystems
Database Management S
ystems
Database Management S
ystems
Database Management S
ystems
Database Management S
ystems
Data Independence
• 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 referring to the higher-level
schema need not be changed.
• Physical data independence (exact location of data,
hardware details, compression, splitting) exists in
most databases and file environments, however
conceptual data independence is very hard to come
18
Database Management S
ystems