2.1.4Schemas, Mappings, and Instances
The overall description of the database is called the database schema. There are three
different types of schema in the database and these are defined according to the levels of
abstraction of the three-level architecture illustrated in Figure 2.1. At the highest level, we
have multiple external schemas (also called subschemas) that correspond to different
views of the data. At the conceptual level, we have the conceptual schema, which
describes all the entities, attributes, and relationships together with integrity constraints. At
the lowest level of abstraction we have the internal schema, which is a complete description
of the internal model, containing the definitions of stored records, the methods of
representation, the data fields, and the indexes and storage structures used. There is only
one conceptual schema and one internal schema per database.
The DBMS is responsible for mapping between these three types of schema. It must
also check the schemas for consistency; in other words, the DBMS must check that each
external schema is derivable from the conceptual schema, and it must use the information
in the conceptual schema to map between each external schema and the internal schema.
The conceptual schema is related to the internal schema through a conceptual/internal
mapping. This enables the DBMS to find the actual record or combination of records
in physical storage that constitute a logical record in the conceptual schema, together
with any constraints to be enforced on the operations for that logical record. It also allows
any differences in entity names, attribute names, attribute order, data types, and so on, to
be resolved. Finally, each external schema is related to the conceptual schema by the
external/conceptual mapping. This enables the DBMS to map names in the user’s view
on to the relevant part of the conceptual schema.