INTRODUCTION
A database is a collection of data elements (facts) stored in a computer in such a
systematic way that a computer program can consult it to answer questions. The answers
to those questions become information that can be used to make decisions that may not be
made with the data elements alone. The computer program used to manage and query a
database is known as a database management system (DBMS).
A database is a collection of related data that we can use for
Defining (specifying types of data)
Constructing (storing & populating)
Manipulating (querying, updating, reporting)
A Database Management System (DBMS) is a software package to facilitate the
creation and maintenance of a computerized database. A Database System (DB) is a DBMS
together with the data.
Features of a database
It is a persistent (stored) collection of related data.
The data is input (stored) only once.
The data is organized (in some fashion).
The data is accessible and can be queried (effectively and efficiently).
FILE SYSTEMS VERSUS DATABASE SYSTEMS
DBMS are expensive to create in terms of software, hardware, and time invested.
Why should we use them? Why couldn’t we just keep all our data in files, and use
word-processors to edit the files appropriately to insert, delete, or update data? And we
could write our own programs to query the data! This solution is called maintaining data in
flat files. However, flat files have the following limitations.
• Uncontrolled redundancy
• Inconsistent data
• Inflexibility
• Limited data sharing
• Poor enforcement of standards
• Low programmer productivity
• Excessive program maintenance
• Excessive data maintenance
Drawbacks of file systems :
Drawbacks of using file systems to store data are:
Data redundancy and inconsistency
Due to availability of multiple file formats, storage in files may cause
duplication of information in different files.
Difficulty in accessing data
In order to retrieve, access and use stored data, we need to write a new
program to carry out-each new task
Data isolation
To isolate data we need to store them in multiple files and different
Formats.
Integrity problems
Integrity constraints (e.g. account balance > 0) become part of program
code which has to be written every time. It is hard to add new constraints or
to change existing ones.
Atomicity of updates
Failures of files may leave database in an inconsistent state with partial
updates carried out
E.g. transfer of funds from one account to another should happen either
completely or Partially.
oncurrent access by multiple users
Concurrent access of files is needed for better performance and it is also true
that Uncontrolled concurrent accesses of files can lead to inconsistencies
E.g. two people reading a balance and updating it at the same time
Several Security related problems caused in file system.
Database Management System Approach
The Data maintained in the form of DBMS has the following advantages
Controlled redundancy
o consistency of data & integrity constraints
Integration of data
o self-contained & represents semantics of application
Data and operation sharing
o multiple interfaces
Services & Controls
o security & privacy controls
o backup & recovery
o enforcement of standards
Flexibility
o data independence
o data accessibility
o reduced program maintenance
Ease of application and development
Limitations of Database Management System
Database Management System is
more expensive
more complex
general
simple
stringent real-time
single user
static
Levels of Abstraction
Physical level : It is also known as internal schema which describes data
storage structures and access paths. It typically uses a physical data
model and the details are hidden from database users. It describes how a
record (e.g. customer) is stored.
Logical level: It is also known as conceptual schema which describes the
structure and constraints for the whole database. It uses a conceptual or
implementation model. It describes data stored in database, and the
relationships among the data.
type customer = record
street : string;
city : integer;
end;
View level: It is also known as External schema, whichdescribes various
user views. Usually uses the same data model as conceptual level. As
shown in Fig 1.1 , Different views may have different interpretations of
the same data item. Application programs hide details of data types.
Views can also hide information (e.g. salary) for security purposes.
Diagram for Levels of Data abstraction