You are on page 1of 6

MODULE-III(DataBase System)

What is Database
Database is a collection of related data and data is a collection of facts and figures
that can be processed to produce information.
Mostly data represents recordable facts. Data aids in producing information, which is
based on facts.
For example, if we have data about marks obtained by all students, we can then
conclude about toppers and average marks.

The database is a collection of inter-related data which is used to retrieve, insert


and delete the data efficiently. It is also used to organize the data in the form of a table,
schema, views, and reports, etc.

For example: The college Database organizes the data about the admin, staff, students
and faculty etc.

Using the database, you can easily retrieve, insert, and delete the information.

Database Management System{DBMS}

 Database management system is software which is used to manage the database. A


database management system stores data in such a way that it becomes easier to
retrieve, manipulate, and produce information.
 DBMS provides an interface to perform various operations like database creation,
storing data in it, updating data, creating a table in the database and a lot more.
 A DBMS is a technology tool that directly supports data management. It is a
package designed to define, manipulate, and manage data in a database.
 Organizations employ Database Management Systems (or DBMS) to help them
effectively manage their data and derive relevant information out of it.

Some well-known DBMSs are MySQL, Microsoft SQL Server, Microsoft Access, Oracle,
SAP, and others are a very popular commercial database which is used in different
applications.

Some general functions of a DBMS:

 Designed to allow the definition, creation, querying, update, and administration of


databases
 Define rules to validate the data and relieve users of framing programs for data
maintenance
 Convert an existing database, or archive a large and growing one
 Run business applications, which perform the tasks of managing business
processes, interacting with end-users and other applications, to capture and
analyze data
DBMS vs. File System
There are following differences between DBMS and File system:

DBMS File System

DBMS is a collection of data. In DBMS, File system is a collection of data. In this


the user is not required to write the system, the user has to write the
procedures. procedures for managing the database.

DBMS gives an abstract view of data File system provides the detail of the data
that hides the details. representation and storage of data.

DBMS provides a crash recovery File system doesn't have a crash


mechanism, i.e., DBMS protects the mechanism, i.e., if the system crashes while
user from the system failure. entering some data, then the content of
the file will lost.

DBMS provides a good protection It is very difficult to protect a file under the
mechanism. file system.

DBMS contains a wide variety of File system can't efficiently store and
sophisticated techniques to store and retrieve the data.
retrieve the data.

DBMS takes care of Concurrent access In the File system, concurrent access has
of data using some form of locking. many problems like redirecting the file
while other deleting some information or
updating some information.

Traditional Approach for Data Storage and the Need of DBMS

Traditional Data Storage Model


1. In traditional approach, information is stored in flat files which are maintained by the
file system under the operating system’s control.
2. Application programs go through the file system in order to access these flat files

How data is stored in flat files


• Data is stored in flat files as records.
• Records consist of various fields which are delimited by a space, comma, pipe, any
special character etc.
• End of records and end of files will be marked using any predetermined character set or
special characters in order to identify them.
Example:  Storing employee data in flat files

Problems with traditional approach for storing data

1. Data Security
The data stored in the flat file(s) can be easily accessible and hence it is not secure.
Example:
Consider an online banking application where we store the account related information of
all customers in flat files. A customer will have access only to his account related details.
However from a flat file, it is difficult to put such constraints. It is a big security issue.

2. Data Redundancy
In this storage model, the same information may get duplicated in two or more files. This
may lead to higher storage and access cost. It also may lead to data inconsistency.
Suppose the same data is repeated in two or more files. If a change is made to data
stored in one file, other files also needs to be change accordingly.

Example: imagine employee details such as firstname, lastname, email-id are stored in
employee_details file and employee_salary file. If a change needs to be made to email-id,
both employee_details file and emplyee_salary file need to be updated otherwise it will
lead to inconsistent data.

However, it is possible to design file systems with minimal redundancy.


Also note that Data redundancy is sometimes preferred.
For example, suppose employee details such as firstname, lastname, email-id are stored
only in employee_details file and not in employee_salary file. If we need to access an
employee salary along with firstname of the employee, we have to retrieve details from
two files. This would mean an increased overhead.
3. Data Isolation
Data Isolation means that all the related data is not available in one file. Usually the data
is scattered in various files having different formats. Hence writing new application
programs to retrieve the appropriate data is difficult.

4. Program/Data Dependence
In traditional file approach, application programs are closely dependent on the files in
which data is stored. If we make any changes in the physical format of the file(s), like
addition of a data field , etc, all application programs needs to be changed accordingly.
Consequently, for each of the application programs that a programmer writes or
maintains, the programmer must be concerned with data management. There is no
centralized execution of the data management functions. Data management is scattered
among all the application programs.

Example: Consider the banking system. An employee_salary file exists which has details
about the salary of employees. An employee_salary record is described by employee_id,
firstname, lastname, salary_amount.
An application program is available to display all the details about the salary of all
employees. Assume a new data field, the date_of_joining is added to the
employee_salary file. Since the application program depends on the file, it also needs to
be altered.
If the physical format of the employee_salary file for example the field delimiter, record
delimiter, etc. are changed, it necessitates that the application program which depends
on it, also be altered.  

5. Lack of Flexibility
The traditional systems are able to retrieve information for predetermined requests for
data. If we need unanticipated data, huge programming effort is needed to make the
information available, provided the information is there in the files. By the time the
information is made available, it may no longer be required or useful.

Example : Consider a software application which is able to generate employee salary


report. Assume that all the data is stored in flat files. Suppose we now have a
requirement to retrieve all the employee details whose salary is greater than Rs.10000. It
is not easy to generate such on-demand reports and lot of time is needed for application
developers to modify the application to meet such requirements.

6. Concurrent Access Anomalies


Many traditional systems allow multiple users to access and update the same piece of
data simultaneously. However this concurrent updates may result in inconsistent data. To
guard against this possibility, the system must maintain some form of supervision. But
supervision is difficult because data may be accessed by many different application
programs and these application programs may not have been coordinated previously.

Example : Consider a personal information system which has the data of all employees.
Now there may be an employee updating his address details in the system and at the
same time, an administrator may be taking a report containing the data of all employees.
This is called concurrent access. Since the employee's address is being updated at the
same time, there is a possibility of the administrator reading an incorrect address.
These difficulties lead to the development of database systems.

Characteristics of DBMS
o It uses a digital repository established on a server to store and manage the
information.
o It can provide a clear and logical view of the process that manipulates data.
o DBMS contains automatic backup and recovery procedures.
o It contains ACID properties which maintain data in a healthy state in case of failure.
o It can reduce the complex relationship between data.
o It is used to support manipulation and processing of data.
o It is used to provide security of data.
o It can view the database from different viewpoints according to the requirements
of the user.

Characteristics
Traditionally, data was organized in file formats. DBMS was a new concept then, and all
the research was done to make it overcome the deficiencies in traditional style of data
management.
A modern DBMS has the following characteristics −
o Real-world entity − A modern DBMS is more realistic and uses real-world entities to
design its architecture. It uses the behavior and attributes too. For example, a
school database may use students as an entity and their age as an attribute.
o Relation-based tables − DBMS allows entities and relations among them to form
tables. A user can understand the architecture of a database just by looking at the
table names.
o Isolation of data and application − A database system is entirely different than its
data. A database is an active entity, whereas data is said to be passive, on which
the database works and organizes. DBMS also stores metadata, which is data about
data, to ease its own process.
o Less redundancy − DBMS follows the rules of normalization, which splits a relation
when any of its attributes is having redundancy in values. Normalization is a
mathematically rich and scientific process that reduces data redundancy.
o Consistency − Consistency is a state where every relation in a database remains
consistent. There exist methods and techniques, which can detect attempt of
leaving database in inconsistent state. A DBMS can provide greater consistency as
compared to earlier forms of data storing applications like file-processing systems.
o Query Language − DBMS is equipped with query language, which makes it more
efficient to retrieve and manipulate data. A user can apply as many and as different
filtering options as required to retrieve a set of data. Traditionally it was not
possible where file-processingsystem was used.
o ACID Properties − DBMS follows the concepts of Atomicity, Consistency, Isolation,
and Durability normally shortened as ACID. These concepts are applied on
transactions, which manipulate data in a database. ACID properties help the
database stay healthy in multi transactional environments and in case of failure.
o Multiuser and Concurrent Access − DBMS supports multi-user environment and
allows them to access and manipulate data in parallel. Though there are
restrictions on transactions when users attempt to handle the same data item, but
users are always unaware of them.
o Multiple views − DBMS offers multiple views for different users. A user who is in the
Sales department will have a different view of database than a person working in
the Production department. This feature enables the users to have a concentrate
view of the database according to their requirements.
o Security − Features like multiple views offer security to some extent where users
are unable to access data of other users and departments. DBMS offers methods to
impose constraints while entering data into the database and retrieving the same
at a later stage. DBMS offers many different levels of security features, which
enables multiple users to have different views with different features. For example,
a user in the Sales department cannot see the data that belongs to the Purchase
department. Additionally, it can also be managed how much data of the Sales
department should be displayed to the user. Since a DBMS is not saved on the disk
as traditional file systems, it is very hard for miscreants to break the code.

Database Users
A typical DBMS has users with different rights and permissions who use it for different
purposes. Some users retrieve data and some back it up. The users of a DBMS can be
broadly categorized as follows −

 Administrators − Administrators maintain the DBMS and are responsible for


administrating the database. They are responsible to look after its usage and by
whom it should be used. They create access profiles for users and apply limitations
to maintain isolation and force security. Administrators also look after DBMS
resources like system license, required tools, and other software and hardware
related maintenance.
 Designers − Designers are the group of people who actually work on the designing
part of the database. They keep a close watch on what data should be kept and in
what format. They identify and design the whole set of entities, relations,
constraints, and views.
 End Users − End users are those who actually reap the benefits of having a DBMS.
End users can range from simple viewers who pay attention to the logs or market
rates to sophisticated users such as business analysts.

You might also like