0% found this document useful (0 votes)
42 views30 pages

Mr. Binu Vargis Assistant Professor (CSE) : Relational Database Management System (RDBMS) - I

This document provides an introduction to relational database management systems and compares them to traditional file systems. It discusses some of the key problems with file systems like data redundancy, security issues, and concurrency problems. A database management system (DBMS) provides advantages like controlling redundancy, enforcing data integrity, improved security and flexibility, enabling data sharing, and backup/recovery capabilities. The DBMS acts as an intermediary between users, programs, and data. It allows for things like locking mechanisms to prevent concurrency anomalies and integrity constraints to maintain accurate data. Overall, the DBMS approach provides a more robust solution compared to traditional file-based data storage and access.

Uploaded by

BinuVargis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views30 pages

Mr. Binu Vargis Assistant Professor (CSE) : Relational Database Management System (RDBMS) - I

This document provides an introduction to relational database management systems and compares them to traditional file systems. It discusses some of the key problems with file systems like data redundancy, security issues, and concurrency problems. A database management system (DBMS) provides advantages like controlling redundancy, enforcing data integrity, improved security and flexibility, enabling data sharing, and backup/recovery capabilities. The DBMS acts as an intermediary between users, programs, and data. It allows for things like locking mechanisms to prevent concurrency anomalies and integrity constraints to maintain accurate data. Overall, the DBMS approach provides a more robust solution compared to traditional file-based data storage and access.

Uploaded by

BinuVargis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

RELATIONAL DATABASE MANAGEMENT

SYSTEM (RDBMS)-I
INTRODUCTION

Mr. BINU VARGIS


Assistant Professor(CSE)

OBJECTIVE

Objective of this lecture is to make students


be able to understand the basic concepts of
file system and database.
To introduce the problems with traditional
file system and advantages of database over
file system.

INDEX

What is file System?


Characteristics of file system
Traditional method of data storage
Problems with Traditional approach
What is database and DBMS?
Advantages of DBMS
Difference between file system and database

FILE SYSTEM

File system was an early attempt to computerize


the manual filing system.
A file system is a method for storing and organizing
computer files and the data to make it easy to find
and access.
File Systems may use a storage device such as a
hard disk or CD-ROM.

CHARACTERISTICS OF FILE
PROCESSING SYSTEM

It is group of files storing data of an organization.


Each file is independent from one another.
Each file is called flat file.
Each file contained and processed information for one
specific function like accounting or inventory.
Files are designed by using application programs
written in programming languages such as COBOL, C,
C++, etc.

FLAT FILE

A flat file is a file containing records that have


no structured interrelationship

TRADITIONAL METHOD OF DATA


STORAGE

PROBLEMS: TRADITIONAL
APPROACH

Data Security
Data Redundancy
Data Isolation
Program/ Data Dependence
Concurrent Access Anomalies

DATA SECURITY

The data as maintained in flat files is easily


accessible and therefore not secure.
Example: the Customer_Transaction file has
details about the total available balance of all
customers.
A customer wants information about his/her
account balance.
In a file system it is difficult to give the
customer access to only his/her data in the file.
Thus enforcing security constraints for entire
file or for certain data items are difficult.

DATA REDUNDANCY

Often the same information is duplicated in


two or more files.
It may lead to inconsistency
Assume the same data is repeated in two or
more files. If change is made to data in one
file, it is required that change be made to
the data in the other file as well.
If this is not done, it will lead to multiple
different values for same data field.

DATA ISOLATION

Data isolation means that all the related


data is not available in one file.
Generally, the data scattered in various files,
and the files may be in different formats,
therefore writing new application programs
to retrieve the appropriate data is difficult.

PROGRAM/ DATA DEPENDENCE

Assume in a banking system there is need to


find out the names of all customers who live
within a particular postal-code area.
But there is only a program to generate the list
of all customers.
The bank officer has now two choices: either
obtain the list of all customers and extract the
needed information manually or ask a system
programmer to write the necessary application
program.
Both
the
alternatives
are
obviously
unsatisfactory.

CONCURRENT ACCESS ANOMALIES


Many systems allow multiple users to update the data
simultaneously. In such environment, interaction of concurrent
updates may result in inconsistent data.
Example: Bank account A containing Rs. 6000/-. If two transactions
of withdraw funds( Rs 500/- and Rs 1000/- respectively) from
account about same time, result of the concurrent executions may
leave the account in an incorrect state.
Program on the behalf of each withdrawal read the old balance,
reduce amount and write result back.
If both two programs are concurrent they both may read the value
Rs 6000/-.
Depending on which one writes the value last, the account may
contain either Rs 5500/- or Rs 5000/-, rather than the correct
value of Rs 4500/

WHAT IS THE SOLUTION?

DATABASE APPROACH

In order to remove all the above limitations of the


File Based Approach, a new approach was required
that must be more effective known as Database
approach.

A database is a computer based record keeping


system whose over all purpose is to record and
maintain information.

The database is a single, large repository of data,


which can be used simultaneously by many
departments and users.

THE DATABASE MANAGEMENT SYSTEM (DBMS)


DBMS

A database management system is the software system that


allows users to define, create and maintain a database and
provides controlled access to the data.

database management system (DBMS) is basically a collection of


programs that enables users to store, modify, and extract
information from a database as per the requirements.

DBMS

is an intermediate layer between programs and the data.


Programs access the DBMS, which then accesses the data.

The

following are main examples of database applications:

Banking

System

College

Management System

Inventory
Hospital

Control System

Management

WHERE DOES THE DBMS FIT?

PROGRAMMING LANGUAGES

4GL ( Database Query Languages, Data Manipulation, analysis and


Reporting Languages)
High-Level Languages
Assembly Language
Machine Language

DIFFERENCE BETWEEN FILE AND DBMS


OPERATIONS

ADVANTAGES OF DBMS

Controlling redundancy
Enforces integrity constraints
Better security
Better flexibility
Effective data sharing
Enables backup and recovery

CONTROLLING REDUNDANCY

Redundant Data

NON-REDUNDANT DATABASE

In case of centralized database, data can


be shared by number of applications and
whole college can maintain its data with
the following database:

Every application can access the information of others


by joining on the basis of column ( Rollno )

ENFORCING INTEGRITY
CONSTRAINTS

Integrity of data means that data in database is


always accurate.
Integrity constraints are enforced on database.
Example: Let us consider the case of college database
and suppose that college having only B.Tech, M.Tech,
MCA, MSc, BCA, BBA and B.Com. But if a user enters
the class MS, then incorrect information must not be
stored in database and must be prompted that this is
an invalid entry. Integrity is to be enforced on class
attribute.
In file system this constraint must be enforced an all
the application separately.
In case of DBMS this integrity constraint is applied
only once on the class field of the General Office.

HOW TO ENFORCE INTEGRITY?

Integrity rules:
Entity

Integrity rule: Primary key value


should not be null (Mandatory field)
Referential Integrity: The values of foreign
key should match the primary key in parent
table.

SOLUTION TO CONCURRENCY
ANOMALY
S (Shared
Lock)

X (Exclusive
Lock)

True

False

False

False

LOCKS
T1

Lock-X(B);
Read(B,b);
b:=b-50;
Write(B,b);
Unlock(B);
Lock-X(A);
Read(A,a);
a:=a+50;
Write(A,a)
Unlock(A);

T2

Lock-S(A);
Read(A,a);
Unlock(A);
Lock-S(B)
Read(B,b);
Unlock(B);
Display(a+b);

SCHEDULE 1
T1

T2

Lock-X(B);
Read(B,b);
b:=b-50;
Write(B,b)
Unlock(B)

Grant-X(B,T1)

Lock-S(A);
Read(A,a);
Unlock(A);
Lock-S(B)
Read(B,b);
Unlock(B);
Display(a+b);
Lock-X(A)
Read(A,a)
a:=a+50;
Write(A,a)
Unlock(A);

Concurrency-control
manager

Grant-S(A,T2)

Grant-S(B,T2)

Grant-X(A,T2)

DIFFERENCE BETWEEN FILE SYSTEM


AND DBMS

THANK YOU

You might also like