2.introduction of DBMS
2.introduction of DBMS
Introduction to DBMS
By
Amruta Navale
Introduction
• In typical business environment, it is always essential to be able to produce the right information
at the right time with minimum efforts.
• The database shows a change in storage, access and management of data.
• A DBMS (Database Management System) is a complex software system that is used to manage,
store and manipulate data in the database.
• It is utilized by a large variety of users, to retrieve and manipulate data under its control.
• The users could be utilizing that database concurrently from on-line terminals and/or in a batch
environment via application programs written in a high-level language.
Definition of DBMS
• Definition of DBMS :-
• • A data is a collection of information or real fact which can be recorded and have implicit
meaning. • Eg :- Customer_name, price, balance etc can be considered as data.
• • A database is a collection of data, which contains information relevant to an enterprise.
• • A DataBase Management System (DBMS) is collection of inter-related data and a set of
programs to access these data.
• Functions of DBMS :-
• 1. To store data in a database • 2. To organize the data.
• 3. To control access of data. • 4. To protect data ie provide security.
Basic Definitions
• Data :- Data is a collection of raw facts that have implicit meaning.
• Information :- Information is obtained after processing the data.
• Field (Data Item) :- A field is a single unit of data in a stored record. Each field has a
certain data type.
• Record :- A collection of different fields that provide information on an entity is
called a record.
• Data Dictionary :- A Data Dictionary is called as metadata repository.
• As Data Dictionary is a collection of the description of data objects.
• The DBA (Data Base Administrator ) uses this to develop and maintain the database .
• Data and Information
• Data can be defined as a representation of facts, concepts or instructions.
• Information is organized or classified data so that it has some meaningful values.
• Information is the processed data on which few decisions or actions can be taken.
• The processed data must have the following characteristics:
• Timely: Information should be available when required.
• Accuracy: Information should be accurate.
Completeness: Information should be complete.
Definition Of DBMS
• In any organization, data is the basic resource needed to run the organization. This is required by decision makers for processing
and retrieving information.
• Data: A data is collection of information or real fact which can be recorded and have implicit meaning. Customer_name, item-
price, balance etc. can be considered as data.
• Database: The database stores the information useful to an organization.
• A database is shared collection of inter-related data, which is designed to fulfil the information needs.
• For example: Consider the name, telephone number and addresses of the people you know. This data is recorded in an indexed
address book, or stored on a disk, or using a personal computer. This is a collection of related data with an implicit meaning and
hence is a database.
• A database uses the following implicit properties.
• (i) A database represents some aspect of the real world, sometimes called the miniworld. Changes to the miniworld are reflected in
the database.
• (ii) A database is a logical collection of data with some meaning. A random mixture of data cannot be termed as a database.
• (iii) A database is designed, built and populated with data for a specific purpose. It has an intended group of users.
• So, finally we can say that a database has some source from which data are derived, some degree of interaction with events in the
real world, and an audience that is actively interested in the contents of the database.
What is DBMS?
• DBMS stands for Database Management System. We can break it like this DBMS =
Database + Management System. Database is a collection of data and Management
System is a set of programs to store and retrieve those data.
• Based on this we can define DBMS like this: DBMS is a collection of inter-related
data and set of programs to store & access those data in an easy and effective manner.
• What is the need of DBMS?
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.
Why use DBMS?
• To develop software applications In less time.
• Data independence and efficient use of data.
• For uniform data administration.
• For data integrity and security.
• For concurrent access to data, and data recovery from crashes.
• To use user-friendly declarative query language.
• Where is a Database Management System (DBMS) being Used?
• Airlines: reservations, schedules, etc
• Telecom: calls made, customer details, network usage, etc
• Universities: registration, results, grades, etc
• Sales: products, purchases, customers, etc
• Banking: all transactions etc.
Application of DBMS
• Railway Reservation System
• Database is required to keep record of ticket booking, train’s departure and arrival status. Also if trains get late
then people get to know it through database update.
• Library Management System
• There are thousands of books in the library so it is very difficult to keep record of all the books in a copy or
register. So DBMS used to maintain all the information relate to book issue dates, name of the book, author
and availability of the book.
• Universities and colleges
• Examinations are done online today and universities and colleges maintain all these records through DBMS.
Student’s registrations details, results, courses and grades all the information are stored in database.
• Human Resource Management
• Big firms have many workers working under them. Human resource management department keeps records
of each employee’s salary, tax and work through DBMS.
Components of DBMS
Users: Users may be of any kind such as DB administrator, System developer, or database users.
Database application: Database application may be Departmental, Personal, organization's and /
or Internal.
DBMS: Software that allows users to create and manipulate database access,
Database: Collection of logical data as a single unit.
• A Database Management System (DBMS) is a software system that allows the user to define,
manipulate and process the data in a database, in order to produce meaningful information.
• The basic functions of DBMS are:
• 1. To store data in a database.
• 2. To organize the data.
• 3. To control access of data.
• 4. To protect data i.e. provide security.
• Defining a database involves specifying the data types, structures and constraints for the data to be
stored in the database.
• Constructing the database means storing the data itself on some storage medium that is controlled
by the DBMS.
• Manipulating a database includes such functions as querying the database to retrieve specific data,
updating the database to reflect changes in the miniworld, and generating reports from the data.
• So in general, user can write programs or queries; while DBMS use the database stored on storage
devices and gives meaningful information.
• The database system is illustrated in given figure.
Applications Of Dbms
• DBMS is used for organizing, analyzing and modifying the information's stored in a database.
• There are various applications available.
• These are listed below:
• - Computerized Library System.
• - Automated Teller Machines (ATMs).
• - Airlines (flight) Reservation System.
• -Inventory Management System.
• - Fashion designing.
• -Banking.
• -Universities - Registration, Grades.
• -Sales - Customer, Product, Purchases.
• -Manufacturing - Production, Inventory, Orders, Supply Chain etc.
File Processing System Vs Dbms
1. Data Redundancy :-
It means same information is unnecessarily duplicated in several files.
2. Separated and Isolated data :-
Suppose same information was stored in more than one file. This repetition of data caused loss of data
integrity. (Integrity means accurate and consistent data.)
For example :- Address of an employee was stored in three different files. If change of address occurs and
have been updated in one file only, then mismatch of information gives inconsistency to data.
3. Difficulty in accessing data :-
If the format ( sal→ int, real) of a certain record was changed the code must be immediately updated,
otherwise system provides incorrect data.
4. Integrity Problems :-
The data values may need to satisfy some integrity constraints.
• 5. Concurrent Access Anomalies :- Once a file is opened by a user, the access to the file is denied
for another user, till the first user closes the file. Sharing a file by various users at the same time is
not possible.
• • 6. Security Problems :- If one user ‘A’ does some changes and store them in a database, and
second user also does some new changes and store them in a database. Then the changes done by
‘A’ are lossed. This is the file security problem in file processing.
File system Vs DBMS
File Processing System
Advantages of DBMS
• The users of the database system can be classified on the basis of degree of expertise or
mode of their interactions with DBMS.
• There are 4 groups of users of DBMS:
1. Database designers.
2. Applications programmers.
3. Sophisticated users.
4. End users.
Database Designers
There are two main database designers.
(i)Database manager.
(ii)Database administrator.
i) Database Manager
• A database manager is supervising authority over the Database Administrator.
• A database manager manages and updates a database. The database manager has some knowledge about the
database, but need not be having the same expertise as the database administrator.
• Actually the database administrator takes care of the database. The database administrator can create, delete and
update a database.
ii)Database Administrator (DBA)
• The DBA is an individual person or group of persons (a team) who must have a good knowledge in data processing.
• DBA must have sufficient technical knowledge to make decisions in the organization.
• The DBA must manage the staff to ensure orderly development of the database project, to satisfy database users and
to plan for future database requirements.
Responsibilities of DBA
• 1. Deciding information contents of the database i.e. decide conceptual and internal schema. The
data dictionary is created by DBA, so users can query the dictionary.
• 2. DBA decides the storage structures and access strategy i.e. which user can retrieve what.
• 3. Defines authorization checks and validation procedures. DBA checks validity before giving
access.
• 4. Define strategies for backups and recovery.
• 5. Define security and integrity rules.
• 6. DBA monitors the system performance.
• Application Programmers
• They are computer professionals.
• They are responsible for the development of application programs.
• For the development of application program, they use a general purpose programming language like C, COBOL
and Pascal.
• By using these programs, these people handle or manipulate the databases.
• Sophisticated Users
• These people are also computer professional but they do not write programs.
• To interact with the system, they use query languages like SQL.
• Specialized Users
• They are sophisticated users. They write specialized database application programs.
• For example: Computer-aided design system, knowledge base and expert systems, etc.
• End Users:-
• End Users who unaware of the presence database system or any other system.
• These users are called as unsophisticated users who interact with system through already written
permanent programs.
• They are also called as Naive users.
• DBMS allows us to store and retrieve data. DATA MODELS
• Data consists of facts, which became information when they are processe.This information is conveyed to people.
• For example: if order and payments are the data, then balance due and the quantity in hand would be the information.
• While designing a database, developer has to make decisions about the data which stored in a database. The structure and
relationship of that data has to be decided.
• So developer uses some methods to create a database for the user and system implementation.
• These methods are called Models.
• A model defines the method of storing and retrieving data.
• A model is an abstraction process that hides the details which are not required while highlighting details required to the
applications at hand.
• A data model is a collection of conceptual tool for describing data, its relationship data semantics and data constraints.
• A Data Model consists of:
• 1. A named logical unit i.e. record type and data item.
• 2. Relationship among these logical units.
• 3. Data item is logical unit of data and record type is collection of data items.
• Actually, it provides abstraction of database application.
There are three types of data models available,
1. Object Based Logical Models
• -i) Entity-Relationship Model
• – ii) Object Oriented Model
• In multi-user system, many users do not use entire database, but read some fields of it.
• For security purpose DBMS allows to create different views of single table.
• Because of this facility users will have separate logical structure (as shown in Fig), so
original database remains as it is. This access is provided by DBA only.
• At the physical level, employee record can be described as a block of consecutive storage
location (For example: word or bytes).
• At the conceptual level, each record is described by a type definition and in view level,
different views of the database are defined.
• For example, ATM machines in a bank see only that part of the database that has information
on customer accounts.
• They cannot access information concerning salaries of employees.
View Level
• View level is the highest level of data abstraction.
• Each view in the view level is used to describe a part of the database that a particular user group
is interested in and hides the rest of the database from that user group.
• Example :- There is an Employee table which has empno, ename, designation and salary.
• Suppose user ‘A’ want to view only empno and ename and user ‘B’ wants to view only empno,
designation and salary. We can provide two different views to user ‘A’ and user ‘B’ to satisfy their
requirements.
• User A creates the following view-
• Create view v1 as select empno, ename from employee;
• To see the contents of view give following command- • Select * from v1;
• User B creates the following view –
• Create view v2 as select empno, designation, salary from employee;
• To see the contents of view give following command- • Select * from v2;
Conceptual Level
• • It is the next higher level of data abstraction. • It is used by DBA to
describe what data are stored in the database and the relationship between
those data.
• • The structure of a table is specified in terms of attributes and its data types.
• • Example –
• • Dept( dno, dname, location)
• • Emp ( empno, ename, designation, salary)
Physical Level
• • It is the lowest level of data abstraction.
• • It describes how the data is actually stored on secondary storage devices
such as disk and tapes
• ie which file organization (heap/sorted/hash/index) to be used to store the
relations and what indexes must be created to speed up the retrieval
operations.
Data Independence
• Data independence means it is ability to change the overall logical or physical
structure of the data without changing the application programs or views of data
ie views created for users doesn’t have any change.
• There are 2 levels of data independence:
1) Physical Data Independence
2) Logical Data Independance
Physical Data Independence
• It is the ability to change the internal schema without having to change the conceptual or
external schemas.
• For improving performance, we need to reorganize some physical files.
• This requires to implement changes to the internal schema.
• In this, the conceptual schema separates the users from the changes in the physical storage
of the data.
• Physical data independence is easier to achieve as compared to Logical Data Independence
Logical Data Independence
• It is the ability to change the conceptual schema without having to change the
application programs or external schemas.
• In this type of data independence, the users are protected from changes in the logical
structure of the data.
• Only the view definition and the mapping need be changed in DBMS that supports
logical data independence.
Structure Of DBMS
• Database Management System (DBMS) is a software that allows access to data stored in a database and provides an
easy and effective method of –
• Defining the information.
• Storing the information.
• Manipulating the information.
• Protecting the information from system crashes or data theft.
• Differentiating access permissions for different users.
• The database system is divided into three components:
1)Query Processor
2)Storage Manager
3)Disk Storage.
1. Query Processor
• It interprets the requests (queries) received from end user via an application program into instructions.
• It also executes the user request which is received from the DML compiler.
• Query Processor contains the following components –
• DML Compiler –
• It processes the DML statements into low level instruction (machine language), so that they can be executed.
• DDL Interpreter –
• It processes the DDL statements into a set of table containing meta data (data about data).
• Query Optimizer –
• It executes the instruction generated by DML Compiler.
2. Storage Manager
• Storage Manager is a program that provides an interface between the data stored in the database
and the queries received.
• It is also known as Database Control System.
• It maintains the consistency and integrity of the database by applying the constraints and executes
the DCL statements.
• It is responsible for updating, storing, deleting, and retrieving data in the database.
It contains the following components –
• Authorization Manager –
It ensures role-based access control, i.e,. checks whether the particular person is privileged to
perform the requested operation or not.
• Integrity Manager –
It checks the integrity constraints when the database is modified.
• Transaction Manager –
• A Transaction is a collection of operations that performs a single logical function in database application.
• Each transaction is unit of both atomicity & consistency.
• Thus we require that transactions dont violet any database consistency constraints.
• That is database is consistent when transaction started,the database must be consistent when the
transaction succesfully terminates.
• It controls concurrent access by performing the operations in a scheduled way that it receives the
transaction.
• Thus, it ensures that the database remains in the consistent state before and after the execution of a
transaction.
• File Manager –
• It manages the file space and the data structure used to represent information in the database.
• Buffer Manager –
• It is responsible for cache memory and the transfer of data between the secondary storage and main
memory.
3. Disk Storage
• It contains the following components –
• Data Files –
• It stores the data.
• Data Dictionary –
• It contains the information about the structure of any database object.
• It is the repository of information that governs the metadata.
• Indices –
It provides faster retrieval of data item.
Query processor Components