0% found this document useful (0 votes)
8 views

2.introduction of DBMS

Uploaded by

Amruta Navale
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

2.introduction of DBMS

Uploaded by

Amruta Navale
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 72

Chapter 2

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

• In a file system, the records are stored in separate files.


• Each file is called a flat file.
• For accessing the data from these files, various programs are written.
• In file processing system, the records are stored in file is called a flat file.
• To access the data from these flat files, various programs are written.
• If user wants simple change in the resultant database, lot of changes are needed in the
application programs.
• As system became more complex file processing system losses its flexibility.
Limitations of File System

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

• 1. In DBMS, the data can be shared among all authorized users.


• 2. Inconsistency of data is avoided.
• 3. The DBMS uses different techniques to access the stored data very efficiently.
• 4. Program and data interdependency is decreased.
• 5. Security to data is provided.
• 6. The DBMS has back up and recovery subsystem.
• 7. Data quality is maintained.
• 8. User can monitor database performance.
• 9. Cost of software development is reduced.
• 10. The overall productivity of the programmer is increased.
Disadvantages
• 1. Cost of Software and hardware is more :- CPU having high speed of data
processing and large memory size is needed.
• 2. Difficulty of data migration :- It is difficult to convert data files into database.
• 3. Requirement of technical staff :- Trained technical persons are required to handle.
• 4. Impact of failure :- The data is valuable and it is integrated into a single database.
Due to some failure, if a database is corrupted, then valuable data may be lost.
• 5. Cost of Training :-Training of staff to manage the database operations requires
some amount.
• A DBMS is a piece of software that is designed to make all tasks easier.
• By storing a data in DBMS, rather than in files, we can use the DBMS feature to manage the data
in a robust and efficient manner. •
• The major components of DBMS are as follows:
• Applications:
• The user can write the queries or PL/SQL statements to get some results •
• Transaction Management:
• A transaction is a set of database operations in a particular order.
• • A transaction can update a record, delete a record or modify
• set of records. •
• To save(store) these changes permanently in database, commit the changes.
• • If you do not want to save(store) the change permanently, roll back it.
• Concurrency Control:
• • It is database activity which co-ordinates the action of database manipulation.
• Recovery Management:
• • This ensures that aborted or failed transaction does not create any unfavourable effect on the
database.
• Security Management:
• • The data should be protected against unauthorized access.
• • Security management ensures that only authenticated users should have access to the database.
• • It provides access privileges to users.

Storage Management:
• • DBMS provide this facility/service to store the data permanently in secondary storage device.
• • It also interfaces with operating system to access the physical storage.
Characteristics of DBMS:
1. Users file approach:
• In file processing, each user defines and implements files needed for a specific application.
• Hence more storage space is required.
• In DBMS, a single database is maintained that is defined once and is accessed by various users.
• DBMS software is not written for specific application
2. Self-describing nature of DBMS system:
• A DBMS contains database as well as a complete definition of the database, which is stored in the system catalog.
• It contains information such as structure of each file, the type and storage format of each data item and various constraints
of the data.
• The catalog is used by DBMS software by database users who need information about database.
• For example, a company databases, a banking database, a university database.
• In DBMS the database definition is stored in the catalog.
• In File Processing, data definition is part of the application programs.
• 3. isolation between Programs and Data:
• DBMS access programs are written independently of any specific files.
• The structure of data files is stored in catalog separately from the access program (program-data independence).
• In file processing, if any change in structure of file is made then, all programs that access this file have to be changed.
Suppose we want to add any field in record of file (say birth_date in student file), then program has to be changed in file
processing.
• 4. Multiple Views:
• DBMS supports multiple views of the data, which a file cannot
• Support.
• For example: one user is only interested for student mark list, other user is interested for courses attended by that student,
these multi-user view are
• satisfied by DBMS.
• 5. Data sharing:
• Sharing of data is possible only in DBMS not in file processing.
Comparison of File Processing System and DBMS File Processing System
ADVANTAGES OF DBMS

1.Cost of software development is reduced.


2. User can get proper logical organization of dataset.
3. Centralization for multi-user is available.
4. Centralized data reduces management problems and duplication data also.
5. Data is independent.
6. User can monitor database performance.
7. Data redundancy and consistency are controllable.
8. Program and data interdependency is decreased.
9. Data flexibility is increased.
10. Data integrity and its quality is maintained.
11. Inconsistency of data is avoided.
12. Same data can be shared by many application programs.
13. Security to data is provided.
USERS 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

2. Record Based Logical Models


• i. Hierarchical Model
• ii. Network Model
• iii. Relational Model

3. Physical Data Models


Object Based Logical Model
• This model is based on collection of objects.
• i) Entity Relationship Model
• – It is based on the facts of real world.
• – It consists of basic objects called Entities and Relationship among these objects(ie entities)
• – An Entity is a ‘thing‘ or ‘object’ in the real world that is distinguishable from other objects.
• – The Entity-Relationship (E-R) Model is widely used in database design.Diagram of E-R Model
ii) Object Oriented Model

• It is based on collection of Object.


• • Each object has its own methods.
• • The value stored for a object and methods are grouped into a logical unit called as
class.
• • A user is allowed to define various object of same class.
• • This model actually talkes about classes and objects .
• • Example :- C++
• These model shows the implementation part.
• These model have three types in it.
• 1. Relational Model.
• 2. Network Model.
• 3. Hierarchical Model.
• 1. Relational Model:
• This model shows a collection of tables to represent both data and relationship.
• Each table consists of multiple columns and each column is recognized by a unique
name.
• For example: In a database, Customer table and Account table are two tables available.
• The relationship between these two tables has been shown by a third table,where one
field or column name from both the table is taken together.
• So a new table called Customer_Amt is formed.
2)Record Based Logical Model
• These data models are used in describing data at the logical and view levels.
• • These are used to describe the logical database structure in terms of records. • There
are three types of models in this category.
• • i) Hierarchical Model
• • Ii) Network Model
• iii) Relational Model
• • i). Hierarchical Model :
• • In this model, data is organized into a tree structure in which each child node can have
only one parent node.
• • At the top of the hierarchy, there is a single node called as ‘root’.Diagram of
Hierarchical Model
• 2. Network Model:
• Data is represented by collection of records and the relationship among the data is represented by
links.
• The records are organized as a collection of arbitrary graphs.
• For example, in customer table extra field or column is considered, which consists of the address
where account table information is stored.
• Information of each link represents the related record address.
• • Above model shows there are two departments- Computer and Electronics. • In the
Computer, there are two employees having empno 101, 102 .In the ‘Leaf’,
information of particular employee is given.
• • Drawback :-
• • It is not possible to insert a new level in the table without altering the structure.
• • Example :-
• • Suppose a new level is required between root and Department, the only alternative is
to create the entirely new structure . To overcome this drawback , the Network Model
is introduced.
ii). Network Model :-

• • In late 1960s, Network Model was formalized. • In network model, data


is represented by collection of records and the relationship
• among the data is represented by links. • The records are organized as a
collection of arbitrary graphs as shown in the fig below.
• • Example :-
• • In the student table, extra field or column is considered which consists of
the ‘memory address’, where the Subject table information is stored. Each
link information represents the related record address.
Network Model Diagram

Here we will get detail information of student by using Link.


Relational Model
• iii) Relational Model :-
• • The relational Model was introduced by Dr. E.F. Codd in 1970. The relational Model
represents data in the form of two-dimension tables called as ‘Relations’.
• • Each table consists of multiple columns and each column is identified by a unique
name.
• • Example :-
• • In a database student table and subject table are the two tables available. The
relationship between these two tables is shown by a third table, where one field or
column name from both the tables is taken together.
Physical Data Models

• This model is used to describe data at the lowest level.


• It describes about the way of data stored in secondary storage device by
representing information such as record formats, record ordering, access path etc.
• It has two types of data models.
1. Unifying model.
2. Frame memory model.
VIEWS OF DATA

• A database management system is a collection of interrelated programs


that allow users to access and modify these files.
• A main purpose of a database management system is to provide abstract
view of the data.
• Data abstraction means hiding the implementation details from the end users. DBMS uses the same
principle.
• It hides the complex details of how the data is actually stored on the secondary storage device in
DBMS.
• There are three levels of data abstraction.
• Physical Level
• Physical level is the lower level of Architecture of DBMS.
• This level describes how the data is actually stored in a database. This level define data structure used
to store the data on secondary storage device.
• Conceptual Level
• The conceptual level describes the structure of the whole database.
• The structure of each table is specified in terms of its attributes.
• Attribute type is specified in terms of logical structure of the database (Fig. 2.4).
• This level is decided by Database Administrator (DBA).
• This level also describes the relationships between various tables.
View Level

• 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).

• Embedded DML Pre-compiler –


• It processes DML statements embedded in an application program into procedural calls.

• 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

• i) DML Compiler and Organizer :-


• When a DML statement is given, It translates the DML statement to low level
instructions which a query evaluation engine understands. It also transforms the user’s
request into more efficient form for the query evaluation engine.
• ii) Compiler and Linker :-
• It converts the DML statements embedded in application program in normal procedure
call in host language, so that it interacts with DML compiler.
• iii) DDL Interpreter :-
• It translates DDL statements into a set of tables and records them in the form of
metadata or data dictionary.
• Query Evaluation Engine :-
• It executes the low level instructions generated by the DML compiler.
• • B) Storage Manager Components :- • They provide an interface between
the low level data stored in database and applications programs and the
queries submitted to the system.
• • Following are the sub-components –
• i) Authorization and Integrity Manager :- • It first checks the authority of users to
access data. Then it checks whether the integrity constraints are satisfied or not.
• • ii) Transaction Manager :-
• • It ensures that the database remains in a consistent state inspite of system failure.
• • It also ensures that concurrent transaction execution proceeds without conflicting.
• • iii) File Manager :-
• • It manages the allocation of space on disk storage and the data structures used to
represent information stored on disk.
• • iv) Buffer Manager :-
• • It is responsible for fetching data for disk storage into main memory and deciding
which data to cache in memory.
Thank You!

You might also like