A subschema is the applications programmers view
of the data within the database pertinent to the specific
application. A subschema has access to those areas, set
types, record types, data items, and data aggregates of
interest in the pertinent application to which it was
designed. Naturally, a software system usually has
more than one programmer assigned and includes more
than one application.
This means there are usually
many different subschemas for each schema.
The following are a few of the many reasons
subschemas are used:
Subschemas provide different views of the data
to the user and the programmer, who do not need
to know all the data contained in the entire
Subschemas enhance security factors and
prohibit data compromise.
Subschemas aid the DBA while assuring data
Each data item included in the subschema will be
assigned a location in the user working area (UWA).
The UWA is conceptually a loading and unloading zone,
where all data provided by the DBMS in response to a
CALL for data is delivered. It is also where all data to be
picked up by the DBMS must be placed.
Schema Data Definition Language (DDL)
The schema data definition language (DDL) is used
for describing a database, which maybe shared by many
programs written in many languages. This description
is in terms of the names and characteristics of the data
items, data aggregates, records, areas, and sets included
in the database, and the relationships that exist and must
be maintained between occurrences of those elements
in the database.
l Data item. A data item is an occurrence of the
smallest unit of named data. It is represented in a
database by a value.
l Data aggregate.
A data aggregate is an
occurrence of a named collection of data items within a
record. There are two kinds-vectors and repeating
groups. A vector is a one-dimensional sequence of data
items, all of which have identical characteristics. A
repeating group is a collection of data that occurs a
number of times within a record occurrence. The
collection may consist of data items, vectors, and
l Record. A record is an occurrence of a named
collection of zero, one, or more data items or data
aggregates. This collection is specified in the schema
DDL by means of a record entry. Each record entry in
the schema for a database determines a type of record,
of which there may be an arbitrary number of record
occurrences (records) in the database. For example,
there would be one occurrence of a PAYROLL-
RECORD type of record for each employee. A
database key is a unique value that identifies a record in
the database to a run unit (program(s)). The value is
made available to the run unit when a record is selected
or stored and maybe used by the run unit to reselect the
. Set. A set is an occurrence of a named collection
of records. The collection is specified in the schema
DDL by means of a set entry. Each set entry in the
schema for a database determines a type of set, of which
there may be an arbitrary number of set occurrences
(sets) in the database. Each type of set specified in the
schema may have one type of record declared as its
owner type of record, and one or more types of records
declared as its member type of record. Each set
occurrence (set) must contain one occurrence of its
defined owner type of record and may contain an
arbitrary number of occurrences of each of its defined
member type of record types. For example, if a set
type QUALIFICATIONS was defined as having owner
record type EMPLOYEE and member record types
JOB and SKILL, each occurrence of set type
QUALIFICATIONS must contain one occurrence of
record type EMPLOYEE, and may contain an arbitrary
number of occurrences of record types JOB and SKILL.
l Area. An area is a named collection of records
that need not preserve owner/member relationships. An
area may contain occurrences of one or more record
types, and a record type may have occurrences in more
than one area. A particular record is assigned to a single
area and may not migrate between areas.
l Database. A database consists of all the records,
sets, and areas that are controlled by a specific schema.
If a facility has multiple databases, there must be a
separate schema for each database. Furthermore, the
content of each database is assumed to be independent.
l Program. A program is a set or group of
instructions in a host language such as COBOL or