F - Edit - Chapter 1
F - Edit - Chapter 1
F - Edit - Chapter 1
INTRODUCTION TO DBMS
1.1 INTRODUCTION
Data
Data is a collection of facts and figures that can be processed to produce information.
In otherwords, Data can be any character, text, word, number, and, if not put into context,
means little or nothing to a human.
Information
Database
Database is a collection of inter-related data which is used to retrieve, insert and delete
the data efficiently. For example, consider employee database consists of following
columns-eno, ename and salary.
DBMS also provides protection and security to the databases. It also maintains data
consistency in case of multiple users. Some examples of popular DBMS namely,
Intoduction to Database 1.2
MySQL
Oracle
SQL Server
IBM DB2
PostgreSQL
Amazon Simple DB (cloud based)
Goals of DBMS
The goal of the DBMS is to provide a convenient and effective method of defining,
storing and retrieving the information contained in a database.
.
1.2 PURPOSE OF DATABASE SYSTEMS
To understand the purpose of database system, let us consider part a savings-bank
enterprise that keeps information about all customers and savings accounts. One way to keeps
information on a computer is to store it in operating system files. To allow users to manipulate
the information, the system has a number of application programs that manipulate the files,
including
A program to debit or credit an account
A program to add a new account
A program to find the balance of an account
A program to generate monthly statements
System programmers wrote these application programs to meet the needs of the bank.
New application programs are added to the system as the need arises. For example,
suppose that the savings bank decides to offer checking accounts. As a result, the bank creates
new permanent files that contain information about all the checking accounts maintained in
the bank, and it may have to write new application programs to deals with situations that do
not arise in savings accounts, such as overdrafts. Thus, as time goes by, the system acquires
more files and more application programs.
This typical file-processing system is supported by a conventional operating system. The
system stores permanent records in various files, and it needs different application programs
to extract records from, and add records to, the appropriate files. Before database management
systems (DBMS) came along, organizations usually stored information in such systems.
1.3 Database Management Systems
1. Data Redundancy: Data Repetition is possible that the same information may be duplicated
in different files, this leads to data redundancy results in memory wastage.
Example: A student is having record in college library and in Examination department. Then
his name, roll number, fathers name and class will be same in both the departments. Also
these departments are not dependent on each other. So it creates lots of duplicates value about
that student and when he needs any change for his name or class then he has to go to both the
departments to make these changes happen otherwise it will create problem for him.
2. Data Inconsistency: Because of data redundancy, it is possible that data may not be in
consistent state.
Example: If you change student name in library then his name should be changed in all the
departments related to the student.
3. Difficulty in Accessing Data: Accessing data is not convenient and efficient in file
processing system.
Example: one of the bank officers needs to find out the names of all customers who live
within a particular postal- code area. If there is no application program for this means, the
officer has 2 alternatives: 1. Preparing the list manually from the list of all customers. 2. Ask
system programmer to write the necessary application programs.
4. Limited Data Sharing: Data are scattered in various files, also different files may have
different formats and these files may be stored in different folders may be of different
departments. So, due to this data isolation, it is difficult to share data among different
applications.
Example:
5. Integrity Problems: Data integrity means that the data contained in the database in both
correct and consistent, for this purpose the data stored in database must satisfy correct and
constraints.
Example: The maximum marks of the student can never be more than 100.
6. Atomicity Problems: Any operation on database must be atomic, (i.e.) it must happen in
its entirely or not at all.
Example: If you are buying a ticket from railway and you are in the process of money
transaction. Suddenly, your internet got disconnected then you may or may not have paid for
Intoduction to Database 1.2
the ticket. If you have paid, then your ticket will be booked and if not then you will not be
charged anything. That is called consistent state, means you have paid or not.
7. Concurrent Access Anomalies: Multiple users are allowed to access data simultaneously,
this is for the sake of better performance and faster response.
Example: Consider an operation to debit (withdrawal) an account. The program reads the old
balance, calculates the new balance, and writes new balance back to database. Suppose an
account has a balance of Rs. 5000. Now, a concurrent withdrawal of Rs. 1000 and Rs. 2000
may leave the balance Rs. 4000 or Rs. 3000 depending upon their completion time rather than
the correct value of Rs. 2000.
8. Security Problems: Database should be accessible to users in limited way. Each user should
be allowed to access data concerning his requirements only.
Example: If a student can access his data in the college library then he can easily change
books issued date. Also he can change his fine detains to zero.
To overcome these difficulties, the database management system (DBMS) was developed.
Instance: The data stored in database at a particular moment of time is called instance
of database. Database schema defines the variable declarations in tables that belong to a
particular database; the value of these variables at a moment of time is called the instance of
that database.
Data Model is a collection of conceptual tools for describing data, data relationships,
data semantics and consistency constraints.
It is a collection of conceptual tools for describing data, data relationships and data
constraints. There are various object-based models like,
Entity-Relationship Model
Object Oriented Model
Advantages
1. Exceptional conceptual simplicity
2. Visual representation
3. Effective communication tool
4. Integrated with the relational database model.
Disadvantages
1.3 Database Management Systems
The record based model describes the data structures and access techniques of a
DBMS. There are three types of record-based models viz.
Hierarchical Model
Network Model
Relational Model
Advantages
1. Conceptual Simplicity
2. Database Security
3. Data Independence
4. Database Integrity
5. Efficiency.
Disadvantages
Intoduction to Database 1.2
1. Complex Implementation
2. Difficult to manage
3. Lack of structural independence
4. Implementation limitations
5. Lack of standards
Disadvantages
1. System complexity
1.3 Database Management Systems
Customer Sale
Advantages
1. Structural independence
Intoduction to Database 1.2
a) Storage Manager
b) Query Processor
c) Database Users and Administrators
(1) Authorization and Integrity Manager: which tests for the satisfaction of
integrity constraints and checks the authority of users to access data.
(2) Transaction Manager: which ensures that the database remains in a consistent
state when the system failures and that concurrent transaction executions
proceed without conflicting.
(3) File Manager: which manages the allocation of storage space on disk and data
structures used to store that information’s.
(4) Buffer Manager: which is responsible for fetching data from disk into main
memory.
1.3 Database Management Systems
Data dictionary, which stores meta data about the structure of the database,
in particular schema of the database.
Indices, which can provide fast access to data items. Hashing technique is
used for accessing.
Intoduction to Database 1.2
b) Query Processor
It contains the following components.
DDL Interpreter: which interprets DDL statements (i.e., converts DDL
statement into low level data).
DML Compiler: Which translates DML statements into an low level
instructions that the query evaluation engine understands. Also performs Query
optimization.
Query Evaluation Engine: Which executes low level instructions generated by
the DML compiler.
c) Database Users
Application programmers: Computer professionals who interact with the
system through DML calls, which are embedded in a program written in a host
language (Cobol, PL/I, Pascal, C).
Sophisticated users: Interact with the system through the database query
language.
Specialized users: Specialized users who write specialized database
applications that do the into the traditional data processing frame work (e.g: CAD
system, knowledge based and expert systems.)
Naive Users: Interact with the system by invoking one of the permanent
applications.
Database Administrator: A person who has such central control over the
system is called a database administrator (DBA).
The functions of a DBA include:
1. Schema definition: The DBA creates the original database schema by
executing a set of data definition statements in the DDL.
2. Storage structure and access-method definition.
3. Schema and physical-organization modification: The DBA carries out
changes to the schema and physical organization to reflect the changing
needs of the organization to improve performance.
4. Granting of authorization for data access: By granting different types of
authorization, the database administrator can regulate which parts of the
database various users can access. The authorization information is kept in
a special system structure that the database system consults whenever
someone attempts to access the data in the system.
1.3 Database Management Systems
those data.
c) View level – Describes the part of entire database
a) Data files
b) Data dictionary
c) Indices
PART – B
4. How does DBMS provide data abstraction? Explain the concept of data
independence.
5. With a neat diagram describe the overall system structure of DBMS.