Database Management System

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 64

Introduction of Database

Management System
Module-I
TOPICS TO BE COVERED
1. Difference between Data, Information,
2. Data Processing & Data Management.
3. File Oriented Approach,
4. Database oriented approach to Data
Management,
5. Need for DBMS,
6. Characteristic of Database,
TOPICS TOBE COVERED
7. Database Architecture: Levels of Abstraction,
8. Database schema and instances,
9. 3 tier architecture of DBMS,
10.Data Independence.
11.Database users,
12.Types of Database System.
13.Database Languages,
14.DBMS interfaces.
Data Processing
Data processing is any process that a computer program does to enter data
and summarize, analyze or otherwise convert data into usable information.

• Data Management
• Administrative process by which the required data is acquired, validated,
stored, protected, and processed, and by which its accessibility, reliability,
and timeliness is ensured to satisfy the needs of the data users.
Database Management System
• A database management system (DBMS) is the software that allows a

computer to perform database functions of storing, retrieving, adding,

deleting and modifying data.

• Examples:-Microsoft Access, MySQL, Microsoft SQL Server, Oracle


File System Oriented Approach

A File Management system is a DBMS that allows acces to


single files or tables at a time. In a File System, data is
directly stored in set of files. It contains flat files that have
no relation to other files (when only one table is stored in
single file, then this file is known as flat file).

7
File Processing Systems
Billing Purchasing
Program Program

Customer Accounts Buyer Inventory Vendor


file receivable file file file
file

Accounts_Payable Sales Order Processing Payroll


Program Program Program

Vendor Invoice Customer Inventory Employee


file file file file
file
In a typical file processing systems, each department has its own files, designed
especially for those applications. The department itself works with the data
processing staff, sets policies or standards for the format and maintenance of its files.
Database Approach
Order Dept. Accounting Payroll
Dept. Dept.

Program Program Program

A B C

Ordering
Invoicing Payroll
filing System System
System

Back Inventory Customer Inventory Employee


Orders Master Master Pricing Master
file file file file file
Problem with File System/ Disadvantage
1. File System Data Management
• Requires extensive programming in third-generation
language (3GL)
• Time consuming
• Makes ad hoc queries impossible

11
Problem with File System
2. Data Dependence
1. Change in file’s data characteristics requires
modification of data access programs
2. Must tell program what to do and how
3. Makes file systems cumbersome from programming and
data management views
3. Structural Dependence
1. Change in file structure requires modification of related
programs.
12
Problem with File System
4. Data Redundancy
1. Different and conflicting versions of same data
2. Results of uncontrolled data redundancy
1. Data anomalies
1. Modification
2. Insertion
3. Deletion
2. Data inconsistency
1. Lack of data integrity
13
Why DBMS
Makes data management more efficient and effective

Query language allows quick answers to ad hoc queries

Provides better access to more and better-managed data

Promotes integrated view of organization’s operations

Reduces the probability of inconsistent data


14
What are the advantages of DBMS over File
Oriented System?
1.Enforcement of integrity

2.Transaction management

3.Backup and recovery

4.Security Management

5.Concurrency Control

6.Storage Management
1:-Enforcement of integrity
• It is necessary for the data values stored in a
database to be consistent in certain way.
• By defining validation rule.
• Example:-Account balance of any account should
not be less than 1000. Such integrity can be
maintained by centralized control on database.
2:-Transaction Management
• Transaction is an action that is used to perform some manipulation on data
stored in the database.
• A DBMS is responsible for supporting all the required operations on the
database.
• Execution of transaction required ACID Property.
• Atomicity(A):-All operation of a transaction will take place or none will take effect.
• Consistency(C ):-All records related to that transaction must be accurate.
• Isolation(I):-when two or more transactions run concurrently their effect must be isolated
from each other.
• Durability(D):-once transaction is complete its effect should not lost event if system fails
immediately after transaction.
3:-Backup & Recovery
• This feature ensures restoration of the previous state in
case of logical or physical corruption or loss of data.
• A DBMS keeps backup of copies of the database.

• It keeps a log of all operation performed in the


database so that data can be restored.
4:-Security Management
• Preventing unauthorized database users from accessing the database.

• Preventing user from manipulating any information which is not related the that user.

• Protecting data to prevent unauthorized users from reading or understanding the


content by encrypting it.

5:-Concurrency Control
• Simultaneous access of a single database by multiple users/ programs is possible.

• Under this feature following issues are handled by DBMS


• A wrong view of the database state by one user while other user is updating content of database.
• Updation by multiple users, may lead to inconsistent state.
Benefits of Database Technology
• Controlling redundancy in data storage and in development and
maintenance efforts.
• Sharing of data among multiple users.
• Restricting unauthorized access to data.
• Providing multiple interfaces to different classes of users.
• Representing complex relationships among data.
• Enforcing integrity constraints on the database.

20
Benefits of Database Technology
• Providing backup and recovery services.
• Potential for enforcing standards.
• Flexibility to change data structures.
• Reduced application development time.
• Availability of up-to-date information.
• Economies of scale.
21
Characteristics of DBMS
• Self describing nature of database System.
• Insulation between programs, data and data
abstraction
• Support of multiple view of data.
• Sharing of data and multiuser transaction
processing.
DBMS Vs File processing system
Criterion DBMS File-Processing System

Nature of Data It is a shared set of data that is It is a set of application programs that
Design logically related. Database is serves the end users in various way, by
designed to meet information generating reports. Each program
requirement of an organization. defines and manages its own data.

Redundancies Inconsistency in the data are Redundancies and inconsistency in data


reduced due to single file format. exist due to single file formats and
Data duplication is reduced to duplication of data.
some level.

Integrity Available Not available


Constraints
Data Atomicity Available Not available
Size of software Large small
Criterion DBMS File-Processing System

Accessing Data Data is easily accessed due to Data cannot be easily accessed
standard query procedure. due to special application
programs needed to access data.
Data Isolation Isolation/Retrieval of the required Data isolation is difficult due to
Mechanism data is possible due to common different file format
file format and there are
provisions to retrieve data.
Data Dependency It provides data an program There is dependency between
independence application program and data.
This is because the definition of
data is embedded in the
application program rather than
stored separately

Integrity constraints Integrity constraints ,whether To implement data integrity we


new of old can be enforced as per need to write new application
need. Data integrity is program to ensure data integrity.
determined on the data itself.
Criterion DBMS File-Processing System

Data atomicity Atomicity of updates is Atomicity of update may not


possible be possible

Concurrent data Several user can access data at Concurrent access may
access the same time. cause data inconsistency.

Security features Security features can be It may be very difficult to


implemented very easily enforce security features.

Size of the software A DBMS is usually a large piece Size of the software is small
of software adding to an over as compared to the DBMS.
head
Data Abstraction
1. The major purpose of a database system is to provide users
with an abstract view of the system.
2. The system hides certain details of how data is stored and
created and maintained
3. Complexity should be hidden from database users.
4. There are several levels of abstraction:
1. Physical Level:
2. Conceptual/logical Level:
3. External/View Level:
Physical Level:
1.This is the lowest level of data abstraction. It
describes how data is actually stored in
database. . Ex: B+ Tree , Hashing etc

2.Complex low-level structures described in


detail.
Conceptual Level/Logical :
•Conceptual Level:
•Next highest level of abstraction.
•Describes what data are stored.
•Describes the relationships among data.
•Database administrator level.
View Level:
• View level: Highest level of data abstraction. This
level describes the user interaction with database
system.
Three level of data abstraction
Schema
• A database schema is a visual and logical architecture of a database created on a
database management system. It provides a graphical view of the entire database
architecture and structure. It provides a means for logically grouping and
displaying database objects such as tables, fields, functions and relations Types
are:
• 1 ) A physical schema can be defined as the design of a database at its physical level. In this
level, it is expressed how data is stored in blocks of storage.
• 2 ) Logical Schema defines all the logical constraints that need to be applied on the data
stored. It defines tables, views, and integrity constraints.
Instance or Database instance
• The information in a database at a particular point of
time in called instances of the database.
or
• The actual content of the database at a particular point
in time . Related to the value of a variable
DBMS – Architecture
• The design of a DBMS depends on its architecture. 
• It can be centralized or decentralized or hierarchical. 
• The architecture of a DBMS can be seen as either single tier or
multi-tier.
• An n-tier architecture divides the whole system into related but
independent n modules,
• which can be independently modified, altered, changed, or
replaced.
One Tier Architecture
• In 1-tier architecture, the DBMS is the only entity where
the user directly sits on the DBMS and uses it.
• Any changes done here will directly be done on the
DBMS itself.
• It does not provide handy tools for end-users.
• Database designers and programmers normally prefer to
use single-tier architecture.
Two Tier Architecture
• In two tier architecture of DBMS will have an application
through which the DBMS can be accessed.

• Programmers use 2-tier architecture where they access


the DBMS by means of an application.

• Here the application tier is entirely independent of the


database in terms of operation, design, and programming.
Three tier Architecture of DBMS
• A 3-tier architecture separates its tiers from each
other based on the complexity of the users and
how they use the data present in the database.
• It is the most widely used architecture to design a
DBMS.
Data independence
• Data independence is a form of database management that keeps data
separated from all programs that make use of the data.
• Data independence refers characteristic of being able to modify the
schema at one level of the database system without altering the
schema at the next higher level. In this manner, the data remains
accessible, but is also stable and cannot be corrupted by the
applications using it.
• One of the functions of data independence is to restrict access to the
storage structure of the data by the user applications.
Data independence
• By effectively hiding the specifics of the structure from the
applications, the potential for any one application to alter the nature of
the data becomes impossible.

• Thus, the essential data retains its integrity and remains consistent no
matter how many databases or database applications access the core
data.
• It is of two type
• LOGICAL DATA INDEPENDENCE
• PHYSICAL DATA INDEPENDENCE
LOGICAL DATA INDEPENDENCE
• Logical data is data about database, that is, it stores
information about how data is managed inside. For
example, a table (relation) stored in the database
and all its constraints, applied on that relation.
• Logical data independence is a kind of mechanism,
which liberalizes itself from actual data stored on
the disk. If we do some changes on table format, it
should not change the data residing on the disk.
PHYSICAL DATA INDEPENDANCE
• All the schemas are logical, and the actual data is stored in bit format on the
disk. Physical data independence is the power to change the physical data
without impacting the schema or logical data.
• For example, in case we want to change or upgrade the storage system itself −
suppose we want to replace hard-disks with SSD − it should not have any
impact on the logical data or schemas.

• Accomplishing this shift in file organization or the indexing strategy used for
the data does not require any modification to the external structure of the
applications, meaning that users of the applications are not likely to notice any
difference at all in the function of their programs.
Database User
1. Database Administrators
2. Database Designers
3. End Users
4. System Analysts and Application Programmers
5. Operators and maintenance personnel
Database users
• Database Administrators
• In a database environment, the primary resource is the database
itself and the secondary resource is the DBMS and related software
• authorizing access to the database
• coordinating and monitoring its use
• acquiring software and hardware resources as needed
Database users
• Database Designers
• identifying the data to be stored in the database

• choosing appropriate structures to represent and store this data undertaken before the
database is actually implemented and populated with data
• communicate with all prospective database users, in order to understand their requirements

• develop a view of the database that meets the data and processing requirements for each
group of users
Database users
• End Users
• access to the database for querying, updating, and
generating reports
• use a sophisticated database query language to specify their requests
• typically middle- or high-level managers or other occasional browsers
• constantly querying and updating the database, using standard types of queries
and updates called canned transactions that have been carefully programmed and
tested
• need to learn very little about the facilities provided by the DBMS
• Bank tellers check account balances and post withdrawals and deposits
• Reservation clerks for airlines, hotels, and car rental companies check availability
for a given request and make reservations
Database users
• System Analysts and Application Programmers
• Determine the requirements of end users, especially naive
and parametric end users, and develop specifications for
canned transactions that meet these requirements
• Application programmers implement these specifications as
programs; then they test, debug, document, and maintain
these canned transactions
Structure/ components of DBMS System
• DBMS (Database Management System) acts as an interface
between the user and the database.
• The user requests the DBMS to perform various operations
(insert, delete, update and retrieval) on the database.

• The components of DBMS perform these requested operations


on the database and provide necessary data to the users.
The various components of DBMS are shown below: -
Components of DBMS
1. DDL Compiler 
2. DML Compiler and Query optimizer 
3. Data Manager - 
4. Data Dictionary 
5. Data Files -.
6. Compiled DML - 
7. End Users - 
Components of DBMS
1. DDL Compiler - Data Description Language compiler processes
schema definitions specified in the DDL. It includes metadata
information such as the name of the files, data items, storage details
of each file, mapping information and constraints etc.
2. DML Compiler and Query optimizer - The DML commands such as
insert, update, delete, retrieve from the application program are sent
to the DML compiler for compilation into object code for database
access. The object code is then optimized in the best way to execute
a query by the query optimizer and then send to the data manager.
3. Data Manager - The Data Manager is the central software component
of the DBMS also knows as Database Control System.
The Main Functions Of Data Manager Are: –
•Convert operations in user's Queries coming from the application programs or combination of
DML Compiler and Query optimizer which is known as Query Processor from user's logical view
to physical file system.
• Controls DBMS information access that is stored on disk.
• It also controls handling buffers in main memory.
• It also enforces constraints to maintain consistency and integrity of the data.
• It also synchronizes the simultaneous operations performed by the concurrent users.
• It also controls the backup and recovery operations.
4. Data Dictionary -
Data Dictionary is a repository of description of data in the database. It contains
information about
• Data :- names of the tables, names of attributes of each table, length of attributes, and
number of rows in each table.
• Relationships between database transactions and data items: referenced by them which is
useful in determining which transactions are affected when certain data definitions are
changed.
• Constraints on data: i.e. range of values permitted.
• Detailed information on physical database :design such as storage structure, access
paths, files and record sizes.
• Access Authorization: - is the Description of database users their responsibilities and
their access rights.
• Usage statistics: such as frequency of query and transactions.
Type of Database Systems

• Based on Number of Users


• Single-user
• Desktop database
• Multiuser
• Workgroup database
• Enterprise database
• Scope
• Desktop
• Workgroup
• Enterprise
Types of Database Systems
• Base on Location
• Centralized
• Distributed
• Use
• Transactional (Production)
• Decision support
• Data warehouse
PC Databases
E.g.:
Access
FoxPro
Dbase
Etc.
Centralized Databases

Central
Computer
Client / Server Databases
Client

Client
Network

Database
Server
Client
Distributed Databases
Location B
Location C

computer
computer

Homogeneous
computer Databases
Location A
Distributed Databases
Heterogeneous Client
Or Federated Remote
Databases Comp.
Database
Server
Local Network
Communication
Server
Remote
Client Comp.
Database languages

1. Data Definition Language (DDL)


2. Data Manipulation Language (DML)
Data Definition Language (DDL)
• data definition language, used by the DBA and database designers to define
the conceptual and internal schemas.
• 
• The DBMS has a DDL compiler to process DDL statements in order to identify
the schema constructs, and to store the description in the catalogue.
• 
• In databases where there is a separation between the conceptual and
internal schemas, DDL is used to specify the conceptual schema, and SDL,
storage definition language, is used to specify the internal schema
Data Manipulation Language

• Data Manipulation Language (DML) is used for data manipulation.

Data manipulation includes


          Retrieval of Information Stored in Database
          Insertion of Information to the database
          Deletion of information from the database
          Updating of information stored in the database
Types of Data Manipulation Language (DML) 

1. Procedural DML

2. Non Procedural DML(Declarative DML )


Procedural DML: In procedural Data manipulation language user has to specify what data are needed

and how to get it.

Non Procedural DML(Declarative DML )

In declarative Data manipulation language user has to specify what data are needed without

specifying how to get it. Example : SQL (Structured Query Languages)

•  

You might also like