DATABASE MANAGEMENT SYSTEM
UNIT-I
INTRODUCTION
What is data?
Data is the known facts or figures that have implicit meaning. It can also be defined as it is
the representation of facts, concepts or instruction in a formal manner, which is suitable for
understanding and processing. Data can be represented in alphabets (A-Z, a-z), in digits
(0-9) and using special characters (+,-.#,$, etc)
e.g: 25, “Ravi” etc.
Information:
Information is the processed data on which decisions and actions are based. Information
can be defined as the organized and classified data to provide meaningful values.
Eg: “The age of Ravi is 25”
File:
File is a collection of related data stored in secondary memory.
File oriented approach:
The traditional file oriented approach to information processing has for each application a
separate master file and its own set of personal file. In file oriented approach the program
dependent on the files and files become dependent on the files and files become
dependents upon the programs
Disadvantages of file oriented approach:
1) Data redundancy and inconsistency:
The same information may be written in several files. This redundancy leads to higher
storage and access cost. It may lead data inconsistency that is the various copies of the
same data may longer agree for example a changed customer address may be reflected in
single file but not elsewhere in the system.
2) Difficulty in accessing data:
The conventional file processing system do not allow data to retrieve in a convenient and
efficient manner according to user choice.
3) Data isolation:
Because data are scattered in various file and files may be in different formats with new
application programs to retrieve the appropriate data is difficult.
4) Integrity Problems:
Developers enforce data validation in the system by adding appropriate code in the
various application program. However when new constraints are added, it is difficult to
change the programs to enforce them.
5) Atomicity:
It is difficult to ensure atomicity in a file processing system when transaction failure occurs
due to power failure, networking problems etc.
(Atomicity: either all operations of the transaction are reflected properly in the database or
non are)
DBMS B.Tech II Year IV Sem Page | 1
,6) Concurrent access:
In the file processing system it is not possible to access a same file for more than one
transaction at same time
7) Security problems:
There is no security provided in file processing system to secure the data from
unauthorized user access.
Database:
Database is a collection of related data and data is a collection of facts and figures that can
be processed to produce information. Data represents recordable facts. Data aids in
producing information, which is based on facts.
Example, if we have data about marks obtained by all students, we can then conclude
about toppers and average marks.
Database Management System (DBMS)
DBMS = Database + Management System.
DBMS is a collection of inter-related data and set of programs to store & access those
data in an easy and effective manner.
A DBMS is a software that allows creation, definition and manipulation of database.
Dbms is a tool used to perform any kind of operation on data in database.
Dbms also provides protection and security to database.
It maintains data consistency in case of multiple users.
Examples of popular dbms: MySql, Oracle, Sybase, Microsoft Access and IBM DB2 etc.
Data in the database may be persistent, integrated and shared.
Persistent: If data is removed from database due to some explicit request from user
to remove.
Integrated: A database can be a collection of data from different files and when any
redundancy among those files are removed from database is said to be integrated
data.
Sharing Data: The data stored in the database can be shared by multiple users
simultaneously without affecting the correctness of data.
NEED OF DBMS
In order to overcome the limitation of a file system, a new approach was required. Hence a
database approach emerged. Database systems are basically developed for large amount
of data. When dealing with huge amount of data, there are two things that require
optimization: Storage of data and retrieval of data.
Storage: According to the principles of database systems, the data is stored in such a
way that it acquires lot less space as the redundant data (duplicate data) has been
removed before storage.
Example: In a banking system, suppose a customer is having two accounts, one is saving
account and another is salary account. Let’s say bank stores saving account data at one
place and salary account data at another place, in that case if the customer information
such as customer name, address etc. are stored at both places then this is just a wastage of
DBMS B.Tech II Year IV Sem Page | 2
,storage (redundancy/ duplication of data), to organize the data in a better way the
information should be stored at one place and both the accounts should be linked to that
information.
Fast Retrieval of data: Along with storing the data in an optimized and systematic
manner, it is also important that we retrieve the data quickly when needed. Database
systems ensure that the data is retrieved as quickly as possible.
Function of DBMS:
Defining database schema: it must give facility for defining the database structure
also specifies access rights to authorized users.
Manipulation of the database: The dbms must have functions like insertion of
record into database updation of data, deletion of data, and retrieval of data.
Sharing of database: The DBMS must share data items for multiple users by
maintaining consistency of data.
Protection of database: It must protect the database against unauthorized users.
Database recovery: If for any reason the system fails DBMS must facilitate data base
recovery.
Advantages of DBMS:
Reduction of redundancies: Centralized control of data by the DBA avoids
unnecessary duplication of data and effectively reduces the total amount of data
storage required avoiding duplication in the elimination of the inconsistencies that
tend to be present in redundant data files.
Sharing of data: A database allows the sharing of data under its control by any
number of application programs or users.
Data Integrity: Data integrity means that the data contained in the database is
both accurate and consistent. Therefore data values being entered for storage could
be checked to ensure that they fall within a specified range and are of the correct
format.
Data Security: The DBA who has the ultimate responsibility for the data in the
dbms can ensure that proper access procedures are followed including proper
authentication schemas for access to the DBS and additional check before
permitting access to sensitive data.
Conflict resolution: DBA resolve the conflict on requirements of various user and
applications. The DBA chooses the best file structure and access method to get
optional performance for the application.
Data Independence: Data independence is usually considered from two points of
views; physically data independence and logical data independence.
Physical data Independence allows changes in the physical storage devices or
organization of the files to be made without requiring changes in the conceptual
view or any of the external views and hence in the application programs using the
data base.
Logical data independence indicates that the conceptual schema can be changed
without affecting the existing external schema or any application program.
DBMS B.Tech II Year IV Sem Page | 3
, Disadvantage of DBMS:
DBMS software and hardware (networking installation) cost is high.
The processing overhead by the dbms for implementation of security, integrity and
sharing of the data.
Centralized database control.
Setup of the database system requires more knowledge, money, skills, and time.
The complexity of the database may result in poor performance.
COMPONENTS OF DATABASE SYSTEM
The database system can be divided into four components.
Users: Users may be of various type such as DB
administrator, System developer and End users.
Database application: Database application may
be Personal, Departmental, Enterprise and Internal
DBMS: Software that allow users to define, create
and manages database access, Ex: MySql, Oracle
etc.
Database: Collection of logical data.
Applications of DBMS
Telecom: There is a database to keeps track of the information regarding calls made,
network usage, customer details etc.
Industry: Where it is a manufacturing unit, warehouse or distribution centre, each
one needs a database to keep the records of ins and outs.
Banking System: For storing customer info, tracking day to day credit and debit
transactions, generating bank statements etc.
Education sector: Database systems are frequently used in schools and colleges to
store and retrieve the data regarding student details, staff details, course details,
exam details, payroll data, attendance details, fees details etc.
Online shopping: You must be aware of the online shopping websites such as
Amazon, Flipkart etc. These sites store the product information, your addresses and
preferences, credit details and provide you the relevant list of products based on
your query.
DESCRIBING AND STORING DATA IN A DBMS
A data model is a collection of high-level data description constructs that hide many
low-level storage details
DBMS B.Tech II Year IV Sem Page | 4
UNIT-I
INTRODUCTION
What is data?
Data is the known facts or figures that have implicit meaning. It can also be defined as it is
the representation of facts, concepts or instruction in a formal manner, which is suitable for
understanding and processing. Data can be represented in alphabets (A-Z, a-z), in digits
(0-9) and using special characters (+,-.#,$, etc)
e.g: 25, “Ravi” etc.
Information:
Information is the processed data on which decisions and actions are based. Information
can be defined as the organized and classified data to provide meaningful values.
Eg: “The age of Ravi is 25”
File:
File is a collection of related data stored in secondary memory.
File oriented approach:
The traditional file oriented approach to information processing has for each application a
separate master file and its own set of personal file. In file oriented approach the program
dependent on the files and files become dependent on the files and files become
dependents upon the programs
Disadvantages of file oriented approach:
1) Data redundancy and inconsistency:
The same information may be written in several files. This redundancy leads to higher
storage and access cost. It may lead data inconsistency that is the various copies of the
same data may longer agree for example a changed customer address may be reflected in
single file but not elsewhere in the system.
2) Difficulty in accessing data:
The conventional file processing system do not allow data to retrieve in a convenient and
efficient manner according to user choice.
3) Data isolation:
Because data are scattered in various file and files may be in different formats with new
application programs to retrieve the appropriate data is difficult.
4) Integrity Problems:
Developers enforce data validation in the system by adding appropriate code in the
various application program. However when new constraints are added, it is difficult to
change the programs to enforce them.
5) Atomicity:
It is difficult to ensure atomicity in a file processing system when transaction failure occurs
due to power failure, networking problems etc.
(Atomicity: either all operations of the transaction are reflected properly in the database or
non are)
DBMS B.Tech II Year IV Sem Page | 1
,6) Concurrent access:
In the file processing system it is not possible to access a same file for more than one
transaction at same time
7) Security problems:
There is no security provided in file processing system to secure the data from
unauthorized user access.
Database:
Database is a collection of related data and data is a collection of facts and figures that can
be processed to produce information. Data represents recordable facts. Data aids in
producing information, which is based on facts.
Example, if we have data about marks obtained by all students, we can then conclude
about toppers and average marks.
Database Management System (DBMS)
DBMS = Database + Management System.
DBMS is a collection of inter-related data and set of programs to store & access those
data in an easy and effective manner.
A DBMS is a software that allows creation, definition and manipulation of database.
Dbms is a tool used to perform any kind of operation on data in database.
Dbms also provides protection and security to database.
It maintains data consistency in case of multiple users.
Examples of popular dbms: MySql, Oracle, Sybase, Microsoft Access and IBM DB2 etc.
Data in the database may be persistent, integrated and shared.
Persistent: If data is removed from database due to some explicit request from user
to remove.
Integrated: A database can be a collection of data from different files and when any
redundancy among those files are removed from database is said to be integrated
data.
Sharing Data: The data stored in the database can be shared by multiple users
simultaneously without affecting the correctness of data.
NEED OF DBMS
In order to overcome the limitation of a file system, a new approach was required. Hence a
database approach emerged. Database systems are basically developed for large amount
of data. When dealing with huge amount of data, there are two things that require
optimization: Storage of data and retrieval of data.
Storage: According to the principles of database systems, the data is stored in such a
way that it acquires lot less space as the redundant data (duplicate data) has been
removed before storage.
Example: In a banking system, suppose a customer is having two accounts, one is saving
account and another is salary account. Let’s say bank stores saving account data at one
place and salary account data at another place, in that case if the customer information
such as customer name, address etc. are stored at both places then this is just a wastage of
DBMS B.Tech II Year IV Sem Page | 2
,storage (redundancy/ duplication of data), to organize the data in a better way the
information should be stored at one place and both the accounts should be linked to that
information.
Fast Retrieval of data: Along with storing the data in an optimized and systematic
manner, it is also important that we retrieve the data quickly when needed. Database
systems ensure that the data is retrieved as quickly as possible.
Function of DBMS:
Defining database schema: it must give facility for defining the database structure
also specifies access rights to authorized users.
Manipulation of the database: The dbms must have functions like insertion of
record into database updation of data, deletion of data, and retrieval of data.
Sharing of database: The DBMS must share data items for multiple users by
maintaining consistency of data.
Protection of database: It must protect the database against unauthorized users.
Database recovery: If for any reason the system fails DBMS must facilitate data base
recovery.
Advantages of DBMS:
Reduction of redundancies: Centralized control of data by the DBA avoids
unnecessary duplication of data and effectively reduces the total amount of data
storage required avoiding duplication in the elimination of the inconsistencies that
tend to be present in redundant data files.
Sharing of data: A database allows the sharing of data under its control by any
number of application programs or users.
Data Integrity: Data integrity means that the data contained in the database is
both accurate and consistent. Therefore data values being entered for storage could
be checked to ensure that they fall within a specified range and are of the correct
format.
Data Security: The DBA who has the ultimate responsibility for the data in the
dbms can ensure that proper access procedures are followed including proper
authentication schemas for access to the DBS and additional check before
permitting access to sensitive data.
Conflict resolution: DBA resolve the conflict on requirements of various user and
applications. The DBA chooses the best file structure and access method to get
optional performance for the application.
Data Independence: Data independence is usually considered from two points of
views; physically data independence and logical data independence.
Physical data Independence allows changes in the physical storage devices or
organization of the files to be made without requiring changes in the conceptual
view or any of the external views and hence in the application programs using the
data base.
Logical data independence indicates that the conceptual schema can be changed
without affecting the existing external schema or any application program.
DBMS B.Tech II Year IV Sem Page | 3
, Disadvantage of DBMS:
DBMS software and hardware (networking installation) cost is high.
The processing overhead by the dbms for implementation of security, integrity and
sharing of the data.
Centralized database control.
Setup of the database system requires more knowledge, money, skills, and time.
The complexity of the database may result in poor performance.
COMPONENTS OF DATABASE SYSTEM
The database system can be divided into four components.
Users: Users may be of various type such as DB
administrator, System developer and End users.
Database application: Database application may
be Personal, Departmental, Enterprise and Internal
DBMS: Software that allow users to define, create
and manages database access, Ex: MySql, Oracle
etc.
Database: Collection of logical data.
Applications of DBMS
Telecom: There is a database to keeps track of the information regarding calls made,
network usage, customer details etc.
Industry: Where it is a manufacturing unit, warehouse or distribution centre, each
one needs a database to keep the records of ins and outs.
Banking System: For storing customer info, tracking day to day credit and debit
transactions, generating bank statements etc.
Education sector: Database systems are frequently used in schools and colleges to
store and retrieve the data regarding student details, staff details, course details,
exam details, payroll data, attendance details, fees details etc.
Online shopping: You must be aware of the online shopping websites such as
Amazon, Flipkart etc. These sites store the product information, your addresses and
preferences, credit details and provide you the relevant list of products based on
your query.
DESCRIBING AND STORING DATA IN A DBMS
A data model is a collection of high-level data description constructs that hide many
low-level storage details
DBMS B.Tech II Year IV Sem Page | 4