Database Systems: Schemas, Subschema and Instances

The plans of the database and data stored in the database are most important for an organization, since database is designed to provide information to the organization. The data stored in the database changes regularly but the plans remain static for longer periods of time.

1. Schema

A schema is plan of the database that give the names of the entities and attributes and the relationship among them. A schema includes the definition of the database name, the record type and the components that make up the records. Alternatively, it is defined as a frame-work into which the values of the data items are fitted. The values fitted into the frame-work changes regularly but the format of schema remains the same e.g., consider the database consisting of three files ITEM, CUSTOMER and SALES. The data structure diagram for this  schema  is  shown  in Figure  1.5.  The  schema  is shown  in  database  language.

Generally, a schema can be partitioned into two categories, i.e., (i) Logical schema and (ii) Physical schema.

  1. The logical schema is concerned with exploiting the data structures offered by the DBMS so that the schema becomes understandable to the It is important as programs use  it  to  construct  applications.
  2. The physical schema is concerned with the manner in which the conceptual database get represented in the computer as a stored database. It is hidden behind the logical schema and can usually be modified without affecting the application

The DBMS’s  provide  DDL and  DSDL to  specify both  the  logical  and physical  schema.

2. Subschema

A subschema is a subset of the schema having the same properties that a schema has. It identifies a subset of areas, sets, records, and data names defined in the database schema available to user sessions. The subschema allows the user to view only that part of the database that is of interest to him. The subschema defines the portion of the database as seen by the application programs and the application programs can have different view of data stored  in  the  database.

The different application programs can change their respective subschema without affecting other’s subschema  or  view.

The Subschema Definition Language (SDL) is used to specify a subschema in the DBMS.

3. Instances

The data in the database at a particular moment of time is called an instance or a database state. In a given instance, each schema construct has its own current set of instances. Many instances or database states can be constructed to correspond to a particular database schema. Everytime we update (i.e., insert, delete or modify) the value of a data item in a record, one state of the database changes into another state. The Figure 1.6 shows an instance of the ITEM  relation  in  a  database  schema.

Source: Gupta Satinder Bal, Mittal Aditya (2017), Introduction to Database Management System, 2nd Edition-University Science Press (2017)

Leave a Reply

Your email address will not be published. Required fields are marked *