Database System Concepts and Architecture
Database System Concepts and Architecture
Data Independence can be defined as the capacity to change the schema at one level of a database system
without having to change the schema at the next higher level.
For example:
method of representation of alphanumeric data (e.g., changing date format to avoid Y2000 problem)
method of representation of numeric data (e.g., integer vs. long integer or floating-point)
units (e.g., metric vs. furlongs)
Capacity to change the conceptual schema with out having to change external schemas or application
programs. We may change the conceptual schema to expand the database (by adding a record type or
data item) , or to reduce the database (by removing a record type or data items).
• Physical Data Independence:
Capacity to change the Internal schema without having to change the conceptual or external schema. For
example , by creating additional access structures –to improve the performance of retrieval or update.
Advantages of using a DBMS
– Logical Level- The next- Higher level of abstraction describes what data are stored in the DB,
and what relationships exist among those data. DBA, who must decide what information to
keep in the database, use the logical level of abstraction.
– View Level- The highest level of abstraction describes part of the entire database.
• Finally, at the view level, computer users see a set of application programs that
hide details of the data types. Similarly, at the view level, several views of the
database are defined, and db users see these views. In hiding details of the logical
level of the db, the views also provide a security mechanism to prevent users from
accessing certain parts of the db. E.g., tellers in a bank see only the part of the
database that has information on customer accounts; they cannot access
information about salaries of employees.
An Architecture for a Database
System / Phases of Database Design
• Three levels- Internal, Conceptual and External Levels
• The Internal Level is the closest to Physical storage- i.e.,
it is the one concerned with the way the data is
physically stored; Gives Storage View(Representing
the total database as physically stored)
• The External level is the one closest to the users- i.e., it
is the one concerned with the way the data is viewed
by individual users; and Gives individual user view
• The Conceptual level is a “level of indirection” between
the other two. Depicts Community user
• An Example of three levels
• EXTERNAL (PL/I)
• DCL
1 EMPP,
EMP# CHAR(6),
• 2 SAL FIXED BIN(31);
• EXTERNAL (COBOL)
• 01 EMPC
• 02 EMPNO PIC X(6).
• 02 DEPTNO PIC X(4).
• CONCEPTUAL
• EMPLOYEE
• EMPLOYEE_NUMBER CHARACTER (6)
• DEPARTMENT_NUMBER CHARACTER (4)
• SALARY NUMERIC (5)
• INTERNAL
• STORED_EMP LENGTH=20
• PREFIX TYPE=BYTE(6), OFFSET=0
• EMP# TYPE=BYTE(6), OFFSET=6,
INDEX=EMPX
• DEPT# TYPE=BYTE(4), OFFSET=12
• PAY TYPE=FULLWORD, OFFSET=16
• Instances and Schemas – DB change over time as information is inserted
and deleted.
• Instance:
The collection of information stored in the database at a particular
moment is called an instance of the database.
• Schema:
The overall design of the database is called the database schema.
Schemas are changed infrequently, if at all.
Example. The values of the variables in a program at a point in time
correspond to an instance of database schema.
DBS have several schemas, partitioned acc. to the level of abstraction. The
physical schema describes the db design at the physical level, while the
logical schema describes the db design at the logical level. A db may also
have several schemas at the view level, sometimes called subschemas,
that describe different views of the db.
• Database Languages- A DBS provides a data definition
language (DDL) to specify the database schema and a data
manipulation language (DML) to express database queries
and updates and data control language (DCL).
• a) Data definition language – This is the means by which
the content and format of data to be stored is described
and structure of the db is defined, including relationships
between records and indexing strategies. Often known as a
schema.DDL is essentially the link between the logical and
physical views of the db.
Example: in SQL
create table account (account-number char(6), balance
integer)
• Primary Functions of DDL
• Describe the schema and subschema
• Describe the fields in each record and the record’s logical name
• Describe the data type and name of each field
• Indicates the keys on the record
• Provide the data security restrictions
• Provide for logical and physical data independence
• Provide means of associating related data
b) Data Manipulation Language - Data manipulation is
• The retrieval of information stored in the db
• The insertion of new information into the db
• The deletion of information from the db
• The modification of information stored in the db
• A DML is a language that enables users to access or
manipulate data as organized by the appropriate data
model. They are basically 2 types:
• Procedural DMLs require a user to specify what data
are needed and how to get those data. Ex. C Language
Commands, c++, Java, Basic, fortran, cobol, Pascal
• Non Procedural DMLs require a user to specify what
data are needed without specifying how to get those
data.Example Lisp,Prolog
• Procedural DML and Non Procedural DML Verbs are :
Delete , Sort, Insert, Display, Add, select etc.
c) Data Control Language: Used for controlling data
and access to the databases.
• Primary Functions of DCL
• Aid the physical administration of the db such as
dumping, logging, recovery, reorganization, db
initialization, export and import of data etc.
• Help the DBA and system designer to coordinate
and keep track of the data on the db such as DD.
• DCL commands: rollback, grant, alter, revoke etc.
• Database Administrator – A person who has central control over the data and
programs (System) is called a database administrator (DBA).
• Functions of DBA
• Schema definition: The DBA creates the original db schema by executing a set of
data definition statements in the DDL.
• Storage structure and access-method definition and strategy
• Schema and physical-organization modification: DBA carries out changes to the
schema and physical organization to reflect the changing needs of the
organization, or to alter the physical organization to improve performance.
• Granting of authorization for data access: To prevent unauthorized access to the
data in db DBA grants different types of authorization to db users.
• Routine maintenance
– Periodic backup either on tapes or onto remote servers, to prevent loss of data in case of
disasters.
– Database performance tuning and optimization to ensure that enough free disk space is
available for normal operations, and upgrading disk space as required.
– Monitoring jobs running on the db and ensuring that performance is not degraded by very
expensive tasks submitted by some users.
Database Users
• Naive Users who interact with the system by invoking one of the
application programs that have been written previously. For
example , a bank teller who needs to transfer $50 from account A
to account B invokes a program called transfer.
– To retrieve a record, a user must start at the root and navigate the hierarchy.
– If a link is broken, the entire branch is lost.
– Requires considerable data redundancy
• Six Major steps that need to be taken in setting up a
database for a particular enterprise.
• Define the high level requirements of the enterprise
(System requirements Specification )
• Define a model containing all appropriate types of data
and data relationships.
• Define the integrity constraints on the data.
• Define the physical level
• For each known problem to be solved on regular basis
• Create/ initialize the database
• Responsibilities of a database manager/ Storage Manager
A storage manager is a program module that provides the interface
between the low level data stored in the database and the application
programs and queries submitted to the system. The storage manager is
responsible for the interaction with file manager. The storage manager
translates the various DML statements into low level file system
commands. Thus Storage manager is responsible for storing, retrieving,
and updating data in the database.
A transaction is a set of logically related operations. For example, you are transferring money
from your bank account to your friend’s account, the set of operations would be like this: