You are on page 1of 76

Database Management Systems

UNIT-1

• Understanding the DBMS basic concepts

• Know the Applications of DBMS.

• To know the Database Designing for the real time


Objectives:
applications

www.company.com
CS201-DBMS Dept of CSE
UNIT-1

• Students will able to know the DBMS concepts and their


importance.

• Students will able to design the databases for any real time
Outcomes::
applications.

• Students will the constraints to be considered while


designing the databases

www.company.com
CS201-DBMS Dept of CSE
UNIT-1

1. Introduction to Database Systems


2. File System
3. Advantages of DBMS
4. DBA, Designers and End users
Topics:: 5. Data Models
• Relational Model
• Entity-Relationship Model
• Hierarchical Model
• Network Model
• Object-Oriented Model

www.company.com
CS201-DBMS Dept of CSE
Contents

6. Levels of Abstraction or Three-Schema architecture


7. DBMS architecture

8. Classification Of Database Management Systems


Topics:
9. centralized and client/server architectures for dbms

www.company.com
CS201-DBMS Dept of CSE
data
• A data mean known facts or raw facts that can be recorded
and that have implicit meaning.
Topic 1
• For example, consider the names, telephone, numbers, and
Introduction to addresses of the people you know. You may have recorded
Database
Systems this data in an indexed address book, you may have stored it
on a hard drive, using a personal computer and software such
as Microsoft Access, or Excel.

• Information: Processed data.

www.company.com
CS201-DBMS Dept of CSE
Database
• Database is a large collection of related data that
Topic 1 can be stored generally describes activities of an

Introduction to organization.
Database Systems

www.company.com
CS201-DBMS Dept of CSE
Database Properties


It is used to store data of an organization.

A database is designed and developed for a specific purpose.
Topic 1

It has some source from which data is derived and it is
populated with that data.
Introduction to • It can be of any size
Database Systems
• It allows multiple users to share and access database at the
same time.
Eg: - University database which includes students, faculty,
courses & class rooms information along with activities such
as enrolment and teaching courses.

www.company.com
CS201-DBMS Dept of CSE
Database Management System

• A database management system (DBMS) is a collection of


Topic 1 programs (software) for defining, creating, manipulating
and maintaining a database.
Introduction to
Database Systems

www.company.com
CS201-DBMS Dept of CSE
Database Management System

• The DBMS is a general-purpose software package that


Topic 1 facilitates the processes of defining, constructing,
manipulating, and sharing databases among various users and
Introduction to
Database Systems applications.

www.company.com
CS201-DBMS Dept of CSE
Actions of DBMS

• Defining a database involves specifying the data types,


Topic 1 structures, and constraints for the data to be stored in the
database
Introduction to • Manipulating a database includes functions such as querying
Database Systems
the database to retrieve specific data, updating the database
to reflect changes,, and generating reports from the data

• Constructing the database is the process of storing the data


itself on some storage medium that is controlled by the
DBMS.

www.company.com
CS201-DBMS Dept of CSE
Actions of DBMS

• Sharing a database allows multiple users and programs


Topic 1 to access the database concurrently

Introduction to
Database Systems

www.company.com
CS201-DBMS Dept of CSE
Simplified database system
environment

Topic 1

Introduction to
Database Systems

www.company.com
CS201-DBMS Dept of CSE
Database Applications

• Banking: all transactions


Topic 1 • Airlines: reservations, schedules

Introduction to • Sales: customers, products, purchases


Database Systems • Online retailers: order tracking, customized
recommendations

www.company.com
CS201-DBMS Dept of CSE
Database Applications:

• Manufacturing: production, inventory, orders,


supply chain
Topic 1 • Human resources: employee records, salaries, tax
deductions
Introduction to • Universities: registration, grades
Database Systems

www.company.com
CS201-DBMS Dept of CSE
File System

• Before the evolution of DBMS, File Systems are used


Topic 2 to store and manage the data.

• In File System data will be stored in individual files.


File System
• A File is a collection of data.

• Files are typically designed to meet needs of a


particular department or user group.

• Files are also typically designed to be part of a


particular computer application

www.company.com
CS201-DBMS Dept of CSE
File processing processing system

• In the file processing approach, each department


Topic 2 would "own" a collection of relevant data and software
applications to manipulate that data.
File System

www.company.com
CS201-DBMS Dept of CSE
Drawbacks of File System

1. Data Redundancy and Inconsistency


Topic 2 2. Difficulty in accessing data

3. Data isolation
File System
4. Enforcing Integrity constraints

5. Atomicity problems

6. Difficulty in concurrency control

7. Security Problems

www.company.com
CS201-DBMS Dept of CSE
Cont ...

• Data isolation: The data is scattered in different files


and with different formats. So it is difficult to write
Topic 2
application programs to retrieve the data.
File System
• Enforcing Integrity constraints: Data integrity
means, all the data has to obey some condition. In File
System integrity constraints are set at program level.

www.company.com
CS201-DBMS Dept of CSE
Cont ...
Data Redundancy and Inconsistency:

• Data redundancy means appearing same data in different


Topic 2
places.
File System • In file system same information is stored at different places
it causes data-inconsistency problems during updates.

Difficulty in accessing data:

• In order to retrieve data from files we need to write special


application program every time.

• This is not a convenient way because every time the


requirements may change need to write a new program to
carry out each new task
www.company.com
CS201-DBMS Dept of CSE
Cont ...

Atomicity problems:

Topic 2 • Atomicity is a property of a transaction it states that either


all actions to be performed or none.

• In file processing system incomplete transactions cannot


File System
roll back. Due this data will be inconsistent.

Difficulty in concurrency control:

• concurrency means same file is updated by different


application programs at the same time.

• In File Processing System it is not possible to handle


concurrency because of that we can get inconsistent data
www.company.com
CS201-DBMS Dept of CSE
Cont ...
Security Problems:

Topic 2 • Since the information is scattered in different files and


does not have centralized access path, so it is not

File System possible to provide security to the data so that everyone


can access the data.

www.company.com
CS201-DBMS Dept of CSE
Advantages of DBMS
1. Controlling Redundancy

Topic 3 2. Data Consistency

3. Data Security
Advantages of 4. Providing Storage Structures for Efficient Query
DBMS
Processing

5. Providing Backup and Recovery

6. Providing concurrency control

7. Enforcing Integrity constraints

8. Report Writers

www.company.com
CS201-DBMS Dept of CSE
Controlling Redundancy

• In non-database systems (traditional computer file

Topic 3 processing), same data is stored in many places.

• Redundancy leads to several problems 1.duplication effort:


same data can be entered multiple times 2. Storage space is
Advantages of
DBMS wasted. 3. Data inconsistency.

• In DBMS, all the data of an organization is integrated into a


single database.

www.company.com
CS201-DBMS Dept of CSE
Data Consistency:

• By controlling the data redundancy, the data

Topic 3 consistency is obtained.

• If a data item appears only once, any update to its value


has to be performed only once and the updated value
Advantages of
DBMS (new value of item) is immediately available to all
users.

• If the DBMS has reduced redundancy to a minimum


level, the database system enforces consistency.

• It means that when a data item appears more than once


in the database and is updated, the DBMS automatically
www.company.com updates each occurrence of a data item in the database.
CS201-DBMS Dept of CSE
Data Security

• Data security is the protection of the database from

Topic 3 unauthorized users.

• Only the authorized persons are allowed to access the


database.
Advantages of
DBMS • Some of the users may be allowed to access only a part
of database i.e., the data that is related to them or
related to their department.

www.company.com
CS201-DBMS Dept of CSE
Data Security
• Some users may be permitted only to retrieve data,
whereas others are allowed to retrieve as well as to
Topic 3 update data.
• The database access is controlled by the DBA.
• He creates the accounts of users and gives rights to
Advantages of access the database.
DBMS • Typically, users or group of users are given usernames
protected by passwords.
• Most of the DBMSs provide the security sub-system,
which the DBA uses to create accounts of users and to
specify account restrictions.

www.company.com
CS201-DBMS Dept of CSE
Providing Storage Structures for Efficient Query
Processing

• Database systems must provide capabilities to execute

Topic 3 queries and updates efficiently

• Because the database is typically stored on disk, the


DBMS must provide specialized data structures to speed
Advantages of
DBMS up disk search for the desired records.

• Auxiliary files called indexes are used for this purpose.


Indexes are typically based on tree data structures or hash
data structures.

• DBMS supports file manager to manage the allocation of


disk space for the DBMS files.
www.company.com
CS201-DBMS Dept of CSE
Providing Backup and Recovery

• Most of the DBMSs provide the 'backup and recovery'


sub-systems that automatically create the backup of data
Topic 3 and restore data if required.
• For example, if the computer system fails in the middle
(or end) of an update operation of the program, the
Advantages of recovery sub-system is responsible for making sure that
DBMS the database is restored to the state it was in before the
program started executing.

www.company.com
CS201-DBMS Dept of CSE
Providing concurrency control

• DBMS will support concurrency control tools for

Topic 3 permitting multiple users or application programs to


access the database concurrently, while preserving the
consistency of database.
Advantages of
DBMS

www.company.com
CS201-DBMS Dept of CSE
Enforcing Integrity constraints

• Integrity constraints can be applied to database so that

Topic 3 correct data can be entered in to database.

Ex: 1. minimum balance of a account is 1000

Advantages of 2. Max marks of a subject is 100


DBMS
• Most database applications have certain integrity
constraints that must hold for the data.

• A DBMS should provide capabilities for defining and


enforcing these constraints.

• The simplest type of integrity constraint involves


specifying a data type for each data item.
www.company.com
CS201-DBMS Dept of CSE
Report Writers

• Most of the DBMSs provide the report writer tools used


to create reports. The users can create reports very easily
Topic 3 and quickly.
• Once a report is created, it can be used many times and it
can be modified very easily.
Advantages of • The created reports are also saved along with database
DBMS and behave like a software component.

www.company.com
CS201-DBMS Dept of CSE
Actors of DBMS

Topic 4

DBA, Designers
and End users

www.company.com
CS201-DBMS Dept of CSE
Database Administrator(DBA)

• The database administrator is a person having central

Topic 4 control over data and programs accessing the data.

• DBA coordinates all the activities of the database system


Database
Administrator • They are the users who are most familiar with the database
and are responsible for creating, modifying, and
maintaining its three levels.

• Database Administrator is responsible to manage the


DBMS’s use and ensure that the database is functioning.

www.company.com
CS201-DBMS Dept of CSE
Responsibilities of DBA

1. Installing and upgrading the database server and


application tools
Topic 4
2. Allocating system storage and planning future
storage requirements for the database system
DBA
3. Modifying the database structure, as necessary,
from information given by application developers

4. Enrolling users and maintaining system security

5. Ensuring compliance with database vendor license


agreement.

www.company.com
CS201-DBMS Dept of CSE
Responsibilities of DBA

7) Monitoring and optimizing the performance of the

Topic 4 database

8) Planning for backup and recovery of database


information
Responsibilities
of DBA 9) Maintaining archived data

10) Backing up and restoring databases

11) Contacting database vendor for technical support

12) Generating various reports by querying from database


as per need

www.company.com
CS201-DBMS Dept of CSE
Database Designers

• Database designers are responsible for identifying the


data to be stored in the database and for choosing
Topic 4
appropriate structures to represent and store this data.
• These tasks are mostly undertaken before the database is
Database Designers actually implemented and populated with It is the
responsibility of database designers to communicate with
all prospective database users in order to understand their
requirements, and to come up with a design that meets
these requirements.

www.company.com
CS201-DBMS Dept of CSE
Database Designers

• In many cases, the designers are on the staff of the DBA


and may be assigned other staff responsibilities after the
Topic 4
database design is completed.
• Database designers typically interact with each potential
Database Designers group of users and develop views of the database that
meet the data and processing requirements of these
groups.

www.company.com
CS201-DBMS Dept of CSE
End Users

• End users are the people whose jobs require access to


the database for querying, updating, and generating
Topic 4
reports; the database primarily exists for their use.

• There are several categories of end users:


End Users
• Casual end users

• Naive or parametric end users

• Sophisticated end users

• Stand-alone users

www.company.com
CS201-DBMS Dept of CSE
Casual end users

• Casual end users occasionally access the database,


Topic 4
but they may need different information each
time.
End Users
• They use a sophisticated database query language
to specify their requests and are typically middle-
or high-level managers or other occasional
browsers.

www.company.com
CS201-DBMS Dept of CSE
Naive or parametric end users

• Naive or parametric end users make up a sizable portion of


database end users.
Topic 4 • Their main job function is querying and updating the
database, using standard types of queries and updates-called
canned transactions-that have been carefully programmed
and tested.
End Users
• The tasks that such users perform are varied:
• Bank tellers check account balances and post withdrawals
and deposits.
• Reservation clerks fur airlines, hotels, and car rental
companies check availability for a given request and make
reservations

www.company.com
CS201-DBMS Dept of CSE
Sophisticated end users

• Sophisticated end users include engineers, scientists, business

Topic 4 analysts, and others who thoroughly familiarize themselves with


the facilities of the DBMS so as to implement their applications to
meet their complex requirements.
End Users Stand-alone users:

• Stand-alone users maintain personal databases by using ready-made


program packages that provide easy-to-use menu-based or
graphics-based interfaces.

• An example is the user of a tax package that stores a variety of


personal financial data for tax purposes.

www.company.com
CS201-DBMS Dept of CSE
Data Models

• A data model is a collection of concepts that can be used to


describe the structure of a database.
Topic 5 • Structure of a database; mean the data types, relationships,
and constraints that should hold for the data. Most data
models also include a set of basic operations for specifying
Data Models
retrievals and updates on the database.
Types of Data Models
• Relational Model
• Entity-Relationship Model
• Hierarchical Model
• Network Model
• Object-Oriented Model

www.company.com
CS201-DBMS Dept of CSE
Relational Model
• Most commonly used model is the relational model.
• In this model data is organized as two-dimensional tables.
Topic 5 • Each table is called relation.
• The relational model uses a collection of tables to represent
Types of Data both data and the relationships among those data. Each table
Models has multiple columns, and each column has a unique name.
• The relational model is implemented in database where a
relation is represented by a table, a tuple is represented by a
row, and an attribute is represented by a column of the table.

www.company.com
CS201-DBMS Dept of CSE
Entity-Relationship Model
• Entity-Relationship model is based on the notion of real
world entities and relationship among them.
Topic 5 • ER Model is best used for the conceptual design of
database.
Types of Data • ER Model is based on:
Models • Entities and their attributes
• Relationships among entities

www.company.com
CS201-DBMS Dept of CSE
Entity-Relationship Model
Entity
• An entity in ER Model is real world entity, which has some
Topic 5 properties called attributes. Every attribute is defined by its set of
values, called domain.
• For example, in a school database, a student is considered as an
Types of Data entity. Student has various attributes like name, age and class etc.
Models

www.company.com
CS201-DBMS Dept of CSE
Hierarchical Model
• A hierarchical data model is a data model which the data is
organized into a tree like structure.
Topic 5 • First commercial DBMS is based on this model.
• In Hierarchical model data is represented as records and the
Types of Data records organized as collection of trees.
Models • The relationships among the data are represented by links,
which can be viewed as pointers.

www.company.com
CS201-DBMS Dept of CSE
Network Model
Network Model
• In Network model data is represented as records and the
Topic 5 records organized as collection of arbitrary graphs.
• The relationships among the data are represented by links,
Types of Data which can be viewed as pointers.
Models • In network model a record can have any number of parent
records.

www.company.com
CS201-DBMS Dept of CSE
Schemas, Instances, and Database
State
• Database Schema refers to the overall structure of a database.
• The description of a database is called the database schema, which is
Sub topic 5 specified during database design and is not expected to change
frequently
Schema Diagram:

Schema Student

Course

Teacher

www.company.com
CS201-DBMS Dept of CSE
Instance:

• The data in the database at a particular moment in time


is called instance or database state.
subTopic 5 • The distinction between database schema and
database state is very important.
Database state:
instance • At any point in time, the database has a current state.

www.company.com
CS201-DBMS Dept of CSE
Levels of Abstraction or Three-Schema
architecture:

Topic 6

Three-Schema
architecture

3-Schema
Architecture

www.company.com
CS201-DBMS Dept of CSE
Internal level or internal schema:
• The internal schema uses a physical data model and
describes the complete details of data storage and
Topic 6 access paths for the database.
• It tells us what data is stored in the database and how.
At least the following aspects are considered at this
Three-Schema
level:
architecture
• Storage allocation: B-trees, hashing etc.
• Access paths: specification of primary and secondary
keys, indexes and pointers and sequencing..

www.company.com
CS201-DBMS Dept of CSE
Conceptual level or conceptual schema

• The conceptual level has a conceptual schema, which


describes the structure of the whole database for a
Topic 6 community of users.
• The conceptual schema hides the details of physical
storage structures and concentrates on describing
Three-Schema
entities, data types, relationships, user operations,
architecture
and constraints.
• Usually, a representational data model is used to
describe the conceptual schema when a database
system is implemented.

www.company.com
CS201-DBMS Dept of CSE
External level or External View:

External level or External View:


• The external or view level includes a number of external
Topic 6 schemas or user views.
• The external level is the view that the individual user of
the database has.
Three-Schema
architecture • Each external schema describes the part of the database
that a particular user group is interested in and hides the
rest of the database from that user group.

www.company.com
CS201-DBMS Dept of CSE
Data Independence

• Data independence can be defined as the capacity to


change the schema at one level of a database system
6
Topic
without having to change the schema at the next higher
level.

Three-Schema • We can define two types of data independence:


architecture 1 Physical data independence
2. Logical data independence

www.company.com
CS201-DBMS Dept of CSE
Physical data independence:

• Physical data independence is the capacity to change the


Topic 6 internal schema without having to change the conceptual
schema.
Three-Schema
architecture • Hence, the external schemas need not be changed as well.
• Changes to the internal schema may be needed because
some physical files had to be reorganized-for example, by
creating additional access structures-to improve the
performance of retrieval or update.

www.company.com
CS201-DBMS Dept of CSE
Logical data independence:

• Logical data independence is the capacity to


Topic 6 change the conceptual schema without having to
Three-Schema change external schema or application programs.
architecture
• We may change the conceptual schema to expand
the database (by adding a record type or data
item), to change constraints, or to reduce the
database (by removing a record type or data item).

www.company.com
CS201-DBMS Dept of CSE
DBMS architecture

The Functional components of a database system can be

Topic 7 divided in to

• Query Processor Components

• Storage Manager Components


DBMS architecture

www.company.com
CS201-DBMS Dept of CSE
Architecture Diagram

Topic 7

DBMS
architecture

Dbms Architecture

www.company.com
CS201-DBMS Dept of CSE
Query Processor Components
The Query Processor Components include:
DDL interpreter:
Topic 7 • It interprets DDL statements and converts them in to a set
tables which are saved in the data dictionary
DBMS architecture DML compiler:
• It translates DML statements into low-level instructions
that are understood by the Query Evaluation Engine.
• It also optimizes the DML Queries for efficient execution
by the Query Evaluation Engine.
Query evaluation engine:
• It executes low-level instructions generated by the DML
compiler and produces results.

www.company.com
CS201-DBMS Dept of CSE
Storage Manager Components

• These components provide the interface between the low-


level data stored in the database and the Query Processor.
Topic 7
• The storage manager components include:
DBMS architecture Authorization and integrity manager:

• It tests for the satisfaction of integrity constraints and checks


the authority of users to access data.
Transaction manager:
• This component ensures that concurrent transactions proceed
without conflict and the database remains in a consistent
(correct) state despite system failures.

www.company.com
CS201-DBMS Dept of CSE
Storage Manager Components

File manager:
Topic 7 • It manages the allocation of disk-space for the

DBMS architecture
storage of DBMS files.
Buffer manager:
• It is responsible for fetching data from disk storage
into main memory buffers for processing, and then
writing the updated data back onto the disk.

www.company.com
CS201-DBMS Dept of CSE
Data Components

Data files:
• Which store the database itself.
Topic 7 Data dictionary:
• It is a metadata file, which stores the database schema. It
DBMS architecture stores metadata about the structure of the database.
Indices:
• It can provide fast access to data items. Like the index in
this textbook, a database index provides pointers to those
data items that hold a particular value.
Statistical data:
• It stores the statistical information about processing of
previous queries. This information is used by the Query
Processor to optimize the queries.

www.company.com
CS201-DBMS Dept of CSE
CLASSIFICATION OF DATABASE
MANAGEMENT SYSTEMS
Several criteria are normally used to classify DBMSs are
1. Based on data model
Topic 8 2. No of users supported by the System
3. Number of sites over which the database is distributed
CLASSIFICATION 4. Cost
OF DATABASE
MANAGEMENT 5. Types of access path options
SYSTEMS 6. Based on purpose

www.company.com
CS201-DBMS Dept of CSE
1.Based on Data Model:

• The main data model used in many current


commercial DBMSs is the relational data model.
Topic 8 • The object data model was implemented in some
commercial systems but has not had widespread use.
CLASSIFICATION
• Many legacy (older) applications still run on database
OF DATABASE systems based on the hierarchical and network data
MANAGEMENT models.
SYSTEMS • We can hence categorize DBMSs based on the data
model: relational, object, relational, hierarchical,
network, and other.

www.company.com
CS201-DBMS Dept of CSE
2.No of users supported by the System::

Multi-user vs. single-user


• Single-user systems support only one user at a time and are
Topic 8 mostly used with Personal computers.
• Multiuser systems, support multiple users concurrently.
CLASSIFICATION
OF DATABASE
MANAGEMENT
SYSTEMS

www.company.com
CS201-DBMS Dept of CSE
3. Number of sites over which the database is
distributed
Centralized vs. distributed
• A DBMS is centralized if the data is stored at a single computer
Topic 8 site. A centralized DBMS can support multiple users, but the
DBMS and the database themselves reside totally at a single
computer site.
CLASSIFICATION
OF DATABASE
• A distributed DBMS (DDBMS) can have the actual database
MANAGEMENT
and DBMS software distributed over many sites, connected by a
SYSTEMS computer network.

www.company.com
CS201-DBMS Dept of CSE
4. Cost

• The majority of DBMS packages cost between $10,000 and


$100,000.
Topic 8
• Single-user low-end systems that work with micro computers cost
CLASSIFICATION between $100 and $3000. At the other end of the scale, a few elaborate
OF DATABASE packages cost more than $100,000.
MANAGEMENT
SYSTEMS

www.company.com
CS201-DBMS Dept of CSE
5. Access path

• We can also classify a DBMS on the basis of the types of


access path options for storing files. One well-known family
Topic 8
of DBMSs is based on inverted file structures.
CLASSIFICATION
OF DATABASE
MANAGEMENT
SYSTEMS

www.company.com
CS201-DBMS Dept of CSE
6. General-purpose vs. special-purpose

• A DBMS can be general purpose or special purpose. When


performance is a primary
Topic 8
• Consideration, a special-purpose DBMS can be designed
CLASSIFICATION OF
DATABASE and built for a specific application such a system cannot be
MANAGEMENT
SYSTEMS
used for other applications without major changes.

• Many airline reservations and telephone directory systems


developed in the past are special purpose DBMSs.

www.company.com
CS201-DBMS Dept of CSE
centralized and client/server
architectures for dbms

3-tier Architecture:

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

www.company.com
CS201-DBMS Dept of CSE
centralized and client/server
architectures for dbms

www.company.com
CS201-DBMS Dept of CSE
centralized and client/server
architectures for dbms
• Database (Data) Tier − At this tier, the database
resides along with its query processing languages. We
also have the relations that define the data and their
constraints at this level.
• Application (Middle) Tier − At this tier reside the
application server and the programs that access the
database. For a user, this application tier presents an
abstracted view of the database. End-users are unaware
of any existence of the database beyond the
application. At the other end, the database tier is not
aware of any other user beyond the application tier.
Hence, the application layer sits in the middle and acts
as a mediator between the end-user and the database.

www.company.com
CS201-DBMS Dept of CSE
centralized and client/server
architectures for dbms

• User (Presentation) Tier − End-users operate on this


tier and they know nothing about any existence of the
database beyond this layer. At this layer, multiple
views of the database can be provided by the
application. All views are generated by applications
that reside in the application tier.

www.company.com
CS201-DBMS Dept of CSE
Assignment Questions:

• Discuss various disadvantages in the file system and explain


how it can be overcome by the database system

• Explain the advantages of DBMS? What is DBA and


describe the responsibilities of DBA?

• Consider your own assumptions and draw an ER model for


“University Database”

www.company.com
CS201-DBMS Dept of CSE
THANK YOU

www.company.com
CS201-DBMS Dept of CSE

You might also like