0% found this document useful (0 votes)
141 views78 pages

Database Management Systems: Unit - I

The document discusses database management systems and provides an overview of key concepts including what a database is, the components of a DBMS, and common applications that use database systems like banking, airlines, universities, and more.

Uploaded by

Dheeraj Nani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views78 pages

Database Management Systems: Unit - I

The document discusses database management systems and provides an overview of key concepts including what a database is, the components of a DBMS, and common applications that use database systems like banking, airlines, universities, and more.

Uploaded by

Dheeraj Nani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 78

DATABASE MANAGEMENT SYSTEMS

UNIT - I

Text Books:
(1) DBMS by Raghu Ramakrishnan
(2) Database System Concepts by Sudarshan and Korth

Faculty:
SANDEEP PARAITHAM
E-Mail ID: [email protected]
Ph: +91-9032918676 (WhatsApp Number)
+91-8008885484 (Mobile Number)
Friday, August 20, 2021 An Introduction to DBMS 1
INDEX
UNIT-1 PPT SLIDES
S.No. Module (as per Syllabus) Lecture # Slide
------------------------------------------------------------------------------------------------------
1. DB System Application L1
2. DBMS Vs File Systems L1
3. View of DATA - Data Abstraction L2
4. Instances & Schemas L2
5. Data Models (ER, Relational etc.) L2
6. DB Languages (DDL, DML) – DB Access L2/L3
7. DB Users and Administrator L2/L3
8. Transaction Management
9. DBMS Architecture
10. Storage Manager – Query Processor

Friday, August 20, 2021 An Introduction to DBMS 2


Why Study Databases?? ?
• Lots of data is being collected and warehoused EVERYWHERE
• Web data, e-commerce
• Purchases at department/ grocery stores
• Bank/ Credit Card transactions
• Hospitals/ Clinics (Diagnostic Centers)

• Major sources of abundant data


• Business: Web, e-commerce, transactions, stocks
• Science: Remote sensing, bioinformatics, scientific simulation
• Society: news, digital cameras, YouTube

• Datasets increasing in diversity and volume.


– Digital libraries, interactive video, Human Genome project, EOS project
– ... need for DBMS exploding

• DBMS encompasses most of CS


– OS, languages, theory, AI, multimedia, logic

Friday, August 20, 2021 An Introduction to DBMS 3


Data Everywhere
• Lots of data is being collected and
warehoused
– Web data, e-commerce
– Purchases at department/ grocery stores
– Bank/ Credit Card transactions
– Hospitals/ Clinics (Diagnostic Centers)

• Major sources of abundant data


– Business: Web, e-commerce, transactions,
stocks
– Science: Remote sensing, bioinformatics,
scientific simulation
– Society: news, digital cameras, YouTube

Friday, August 20, 2021 An Introduction to Data Mining 4


Data collected and stored at enormous speeds
(GB/hour)
 Remote sensors on a satellite
 Telescopes scanning the skies
 Microarrays generating gene
expression data
 Scientific simulations generating terabytes of data

• The Explosive Growth of Data: from Gigabytes to


Terabytes to Petabytes and more
– Data collection and data availability is on the rise
– This may be due to Automated data collection
tools, Database systems, Web, Computerized
society

Friday, August 20, 2021 An Introduction to DBMS 5


Ultimate aim will be to
Analyze Hidden patterns in the Data
• The Explosive Growth of Data: from
Gigabytes to Terabytes to Petabytes
and more
– Data collection and data
availability is on the rise
– This may be due to Automated
data collection tools, Database
systems, Web, Computerized
society

• We are drowning in data, but starving


for knowledge!

Friday, August 20, 2021 An Introduction to Data Mining 6


What Next after getting Data?
Some Real life Scenarios
• Credit ratings/ targeted marketing:
– Given a database of 1,00,000 names, which persons are the least likely
to default on their credit cards?
– Identify likely responders to sales promotions

• Fraud detection
– Which types of transactions are likely to be fraudulent, given the
demographics and transactional history of a particular customer?

• Customer relationship management:


– Which of my customers are likely to be the most loyal, and which are
most likely to leave for a competitor?
7 Friday, August 20, 2021 An Introduction to Data Mining
Some More Examples

8 Friday, August 20, 2021 An Introduction to Data Mining


9 Friday, August 20, 2021 An Introduction to Data Mining
What is DATA ??
• Collection of facts from which conclusions may be drawn

• Data (Plural of Datum) are the components of information


– They may be the raw facts and figures before interpretation

• Chunks that represent the qualitative or quantitative attributes of a variable


or set of variables

• In computer science,
– data is anything in a form suitable for use with a computer
– Data is often distinguished from programs
– A program is a set of instructions that detail a task for the computer to perform
– In this sense, data is thus everything that is not program code
– They may be 1's and 0's of computer memory, names and addresses in a file

Friday, August 20, 2021 An Introduction to Data Mining 10


What is Information ???
• Knowledge acquired through data i.e. by study or
experience or instruction

• Things that can be known about a topic

• Data that has/ have been processed into a format that is


understandable by its intended audience

• Meaningless data becomes information when it is


processed and presented to the decision maker in a
meaningful way
Friday, August 20, 2021 An Introduction to Data Mining 11
Data Vs Information
DATA INFORMATION
Data can be in the form of numbers, A collection of these data which conveys
characters, symbols, or even pictures some meaningful idea is information

Observations and recordings are done to Analysis is done to obtain information


obtain data

Friday, August 20, 2021 An Introduction to Data Mining 12


Database Terminology
• Database: An electronic storage of Data (OR) A Collection of Entity Sets
(OR) A very large integrated collection of Data

• Entity: A Person, place, event or item

• Data: The facts describing an entity


– (Example: A Registrar would like to have all information about students in a college.
Each student is an Entity)

• Attributes: Each entity can be described by its characteristics, which are


known as attributes.
– (Example: Student Id Number, Last name, First name, Phone number etc.)

• Entity Set: All related entities are collected together to form an Entity Set
– (Example: A ‘STUDENT ‘Entity Set contains data about students only and not about
employees or customers)

Friday, August 20, 2021 An Introduction to DBMS 13


What Is a DBMS??
• A Database Management System (DBMS) is a software package designed to
store and manage databases.

• DBMS is a collection of interrelated data and a set of programs in order to


access those data

• The Database system consists of the following components:

USER

APPLICATIONS DBMS DATABASE

SOFTWARE

HARDWARE

Friday, August 20, 2021 An Introduction to DBMS 14


DBMS Components
• A DBMS software package such as MS-Access, Oracle, Visual Fox Pro etc.

• A User develops and implements database(s) that includes tables, data


dictionary and other database objects

• Custom applications such as data entry forms, reports, queries, blocks and
programs

• Computer Hardware – PC, minicomputers, mainframes in a network


environment

• Software – An Operating System and a Network Operating System

• Personnel – DBA, DB Designer/ Analyst, Programmer, End users


Friday, August 20, 2021 An Introduction to DBMS 15
• Data is the raw material

• Information is the processed, manipulated, collected or


Organized data

• Information is produced when a user uses the applications to


transform data managed by the DBMS

• The database system is utilized as a decision-making system


and is also referred to as an Information System (IS)

Friday, August 20, 2021 An Introduction to DBMS 16


Database System Applications
• DBMS contains information about a particular enterprise
– Collection of interrelated data
– Set of programs to access the data
– An environment that is both convenient and efficient to use

• Database Applications:
– Banking: all transactions
– Airlines: reservations, schedules
– Universities: registration, grades
– Sales: customers, products, purchases
– Online retailers: order tracking, customized recommendations
– Manufacturing: production, inventory, orders, supply chain
– Human resources: employee records, salaries, tax deductions

• Databases touch all aspects of our lives


Friday, August 20, 2021 An Introduction to DBMS 17
Why Use a DBMS?
(File System Vs DBMS)
• What more could we want than a file system?
– Simple, efficient ad-hoc1 queries
– benefits of good data modeling
– Data independence and efficient access
– Reduced application development time
– Data integrity and security
– Uniform data administration
– Application must stage large datasets between main memory and secondary
storage (Example: buffering, page-oriented access, 32-bit addressing, etc.)
– Concurrent access, recovery from crashes

• Small Matter Of Programming? Not really…


– as we’ll see this semester
– in fact, the OS often gets in the way!
-----------------------------
1ad-hoc: formed or used for specific or immediate problems or needs

Friday, August 20, 2021 An Introduction to DBMS 18


Purpose of Database Systems
• In the early days, database applications were built directly on top of file
systems

• Drawbacks of using file systems to store data:


– Data redundancy and inconsistency
• Multiple file formats, duplication of information in different files
– Difficulty in accessing data
• Need to write a new program to carry out each new task
– Data isolation — multiple files and formats
– Integrity problems
• Integrity constraints (e.g. account balance > 0) become “buried” in
program code rather than being stated explicitly
• Hard to add new constraints or change existing ones

Friday, August 20, 2021 An Introduction to DBMS 19


Purpose of Database Systems (Contd..)
• Drawbacks of using file systems (contd..)
– Atomicity of updates
• Failures may leave database in an inconsistent state with partial
updates carried out
• Example: Transfer of funds from one account to another should
either complete or not happen at all
– Concurrent access by multiple users
• Concurrent accessed needed for performance
• Uncontrolled concurrent accesses can lead to inconsistencies
– Example: Two people reading a balance and updating it at the
same time
– Security problems
• Hard to provide user access to some, but not all, data

• Database systems offer solutions to all the above problems


Friday, August 20, 2021 An Introduction to DBMS 20
View of Data
An architecture for a database system

Friday, August 20, 2021 An Introduction to DBMS 21


Levels of Abstraction
• Physical level: describes how a record (e.g.,
customer) is stored.
• Logical level: describes data stored in database,
and the relationships among the data.
– type customer = record
– customer_id : string;
customer_name : string;
customer_street : string;
customer_city : string;
» end;
• View level: application programs hide details of
data types. Views can also hide information (such
as an employee’s salary) for security purposes.
Friday, August 20, 2021 An Introduction to DBMS 22
Instances and Schemas
• Similar to types and variables in programming
languages

• Schema – the logical structure of the database


– (Example: The database consists of information about a
set of “customers” and “accounts” and the relationship
between them)
– Analogous to type information of a variable in a program
– Physical schema: database design at the physical level
– Logical schema: database design at the logical level

Friday, August 20, 2021 An Introduction to DBMS 23


Instances and Schemas
• Instance – the actual content of the database at a
particular point in time
– Analogous to the value of a variable

• Physical Data Independence – the ability to modify


the physical schema without changing the logical
schema
– Applications depend on the logical schema
– In general, the interfaces between the various levels and
components should be well defined so that changes in
some parts do not seriously influence others.

Friday, August 20, 2021 An Introduction to DBMS 24


Data Independence
• Applications insulated from how data is
structured and stored.

• Logical data independence: Protection from


changes in logical structure of data.

• Physical data independence: Protection from


changes in physical structure of data.
 One of the most important benefits of using a DBMS!
Friday, August 20, 2021 An Introduction to DBMS 25
DB Design & ER Diagrams
Design Phases
• User Requirements (Collection & Analysis)
– Data Requirements (Data Analysis)
– Functional Requirements (Functional Analysis)

• Conceptual Schema Design


– ER Diagrams / UML Diagrams

• Logical Design / Data Model Mapping


– Actual Implementation of DB using a DBMS
– Most DBMS use Relational / Object Relational
– Conceptual Schema is transformed from a high level data model to an
Implementation Data Model

• Physical Design
– Internal Storage Structures / Indexes / Access Path / File Organizing for the DB files
– Application Programs / Database Transactions
User Requirements
• Industry / Organization
– Maintaining a User Requirements Documentation
– URD Applicable for ALL projects / applications
– Top Level Meetings with the Client / User / CEO and
who has proposed the project or application
– Meetings include Managers / Project Managers /
Team Leads/ Business Analysts / Data Architects /
Other High Ranked Personnel like Designers / Analysts

• Requirements are then conveyed by the


respective Leads & Analysts to the Designers /
Developers of a Team
What next after Requirements??
• ER Diagrams (Usually chosen for Database Projects)
– More about ER Diagrams in the next few slides

(OR)

• UML (Chosen for DB as well as Software Project as a whole)


– Object Modeling Methodology (Gaining Popularity)
– Can go beyond DB Design
– Can Specify Detailed Design of Software Modules & their
Interaction using various diagrams like Activity Diagrams / Use
Case Diagrams

• OR - Any Other
Data Models
• A collection of tools for describing
– Data
– Data relationships
– Data semantics
– Data constraints

• Relational model

• Entity-Relationship data model (mainly for database design)

• Object-based data models (Object-oriented and Object-relational)

• Semi structured data model (XML)

• Other older models:


– Network model
– Hierarchical model
Friday, August 20, 2021 An Introduction to DBMS 31
Data Models
• A data model is a collection of concepts for
describing data.

• A schema is a description of a particular collection of


data, using the a given data model.

• The relational model of data is the most widely used


model today.
– Main concept: relation, basically a table with rows and
columns.
– Every relation has a schema, which describes the columns,
or fields.
Friday, August 20, 2021 An Introduction to DBMS 32
Relational Model
• Example of tabular data in the relational model
Attributes

Friday, August 20, 2021 An Introduction to DBMS 33


A Sample Relational Database

Friday, August 20, 2021 An Introduction to DBMS 34


Relational Vs ER Model
• Relational Model is usually the Representation of
Data in Tabular form which is more or less a
physical implementation of the Database
Requirements
• But, usually we first come up with a diagrammatic
representation of the same for which we usually
use Entity Relationship Model (ER Model)
• So, after designing using ER Model, we then
convert this design into physical form using
Relational Model

Friday, August 20, 2021 An Introduction to DBMS 35


Components of ER Model

Friday, August 20, 2021 An Introduction to DBMS 36


Entity Relationship Model using ER Diagrams
(Symbols used in ER Diagrams)

Friday, August 20, 2021 An Introduction to DBMS 37


Types of Attributes and Types of Key
• Types of Attributes
– Key Attribute
– Multi valued Attribute
– Derived Attribute
– Composite Attribute
– Discriminator

• Types of Keys
– Super Key
– Candidate Key
– Primary Key
– Foreign Key
Friday, August 20, 2021 An Introduction to DBMS 38
Constraints on Relationships
• Constraints on Relationship Types
– ( Also known as ratio constraints )
– Maximum Cardinality
• One-to-one (1:1)
• One-to-many (1:N) or Many-to-one (N:1)
• Many-to-many
– Minimum Cardinality (also called participation
constraint or existence dependency constraints)
• zero (optional participation, not existence-dependent)
• one or more (mandatory, existence-dependent)

Friday, August 20, 2021 An Introduction to DBMS 39


Structural Constraints – one way to express semantics
of relationships
Structural constraints on relationships:
 Cardinality ratio (of a binary relationship): 1:1, 1:N, N:1, or
M:N
SHOWN BY PLACING APPROPRIATE NUMBER ON THE LINK.
 Participation constraint (on each participating entity type):
total (called existence dependency) or partial.
SHOWN BY DOUBLE LINING THE LINK
NOTE: These are easy to specify for Binary Relationship Types.

Friday, August 20, 2021 An Introduction to DBMS 40


Alternative (min, max) notation for
relationship structural constraints:
 Specified on each participation of an entity type E in a relationship type R
 Specifies that each entity e in E participates in at least min and at most max
relationship instances in R
 Default(no constraint): min=0, max=n
 Must have minmax, min0, max 1
 Derived from the knowledge of mini-world constraints

Examples:
 A department has exactly one manager and an employee can manage at most
one department.
– Specify (0,1) for participation of EMPLOYEE in MANAGES
– Specify (1,1) for participation of DEPARTMENT in MANAGES
 An employee can work for exactly one department but a department can
have any number of employees.
– Specify (1,1) for participation of EMPLOYEE in WORKS_FOR
– Specify (0,n) for participation of DEPARTMENT in WORKS_FOR

Friday, August 20, 2021 An Introduction to DBMS 41


The (min,max) notation relationship
constraints

(0,1) (1,1)

(1,1) (1,N)

Friday, August 20, 2021 An Introduction to DBMS 42


Participation Constraints
• Does every department have a manager?
– If so, this is a participation constraint: the participation of
Departments in Manages is said to be total (vs. partial).
• Every Departments entity must appear in an instance
of the Manages relationship.

since
name dname
ssn lot did budget

Employees Manages Departments

Works_In

since

Friday, August 20, 2021 An Introduction to DBMS 43


Relationship Vs Relationship Set
• Relationship: Association among two or more entities.
E.g., Attishoo works in Pharmacy department.

• Relationship Set: Collection of similar relationships.


– An n-ary relationship set R relates n entity sets
E1 ... En; each relationship in R involves entities e1
E1, ..., en En
• Same entity set could participate in different
relationship sets, or in different “roles” in same
set.

Friday, August 20, 2021 An Introduction to DBMS 44


Degree of a Relationship
 Relationship types of degree 1 are called Unary
 Relationship types of degree 2 are called
Binary
 Relationship types of degree 3 are called
Ternary and
 Relationship types of degree ‘n’ or greater than
3 are called n-ary

Friday, August 20, 2021 An Introduction to DBMS 45


Weak Entity and Identifying Relationship
• An entity that does not have a key attribute

• A weak entity must participate in an identifying relationship type with


an owner or identifying entity type

• Entities are identified by the combination of:


– A partial key of the weak entity type
– The particular entity they are related to in the identifying entity
type

Example:
Suppose that a DEPENDENT entity is identified by the dependent’s first
name and birhtdate, and the specific EMPLOYEE that the dependent is
related to. DEPENDENT is a weak entity type with EMPLOYEE as its
identifying entity type via the identifying relationship type
DEPENDENT_OF
Friday, August 20, 2021 An Introduction to DBMS 46
Weak Entity (Contd…)
• A weak entity can be identified uniquely only by
considering the primary key of another (owner) entity.
– Owner entity set and weak entity set must
participate in a one-to-many relationship set (one
owner, many weak entities).
– Weak entity set must have total participation in this
identifying relationship set.
name
cost pname age
ssn lot

Employees Policy Dependents

Friday, August 20, 2021 An Introduction to DBMS 47


Weak Entity (Contd…)
• An entity set that does not have a primary key is referred to
as a weak entity set.
• The existence of a weak entity set depends on the existence of
a identifying entity set
– it must relate to the identifying entity set via a total, one-
to-many relationship set from the identifying to the weak
entity set
– Identifying relationship depicted using a double diamond
• The discriminator (or partial key) of a weak entity set is the
set of attributes that distinguishes among all the entities of a
weak entity set.
• The primary key of a weak entity set is formed by the primary
key of the strong entity set on which the weak entity set is
existence dependent, plus the weak entity set’s discriminator.
Friday, August 20, 2021 An Introduction to DBMS 48
Weak Entity (Contd…)
• We depict a weak entity set by double rectangles.
• We underline the discriminator of a weak entity set
with a dashed line.
• payment_number – discriminator of the payment
entity set
• Primary key for payment – (loan_number,
payment_number)

Friday, August 20, 2021 An Introduction to DBMS 49


Sample UNIVERSITY Database Requirements
1. In an educational institute, there are several DEPARTMENTS and STUDENTS belong to one of
them. Each department has a unique department number, a name, a location, phone
number and is headed by a professor.
2. PROFESSORS have a unique employee Id, name, phone number. We like to keep track of the
following details regarding students: name, unique roll number, sex, phone number, date of
birth, age and one or more email addresses.
3. Students have a local address consisting of the hostel name and the room number. They also
have home address consisting of house number, street, city and PIN. It is assumed that all
students reside in the hostels.
4. A COURSE taught in a semester of the year is called a SECTION. There can be several sections
of the same course in a semester; these are identified by the section number. Each section is
taught by a different professor and has its own timings and a room to meet.
5. Students enroll for several sections in a semester. Each course has a name, number of credits
and the department that offers it. A course may have other courses as prerequisites i.e,
courses to be completed before it can be enrolled in.
6. Professors also undertake research PROJECTS. These are sponsored by funding agencies and
have a specific start date, end date and amount of money given. More than one professor
can be involved in a project. Also a professor may be simultaneously working on several
projects. A project has a unique projectId.

Friday, August 20, 2021 An Introduction to DBMS 50


Example – ER Diagram for UNIVERSITY DB
Contd… – ER Diagram for UNIVERSITY DB
Example – COMPANY Database
• Requirements of the Company (oversimplified for
illustrative purposes)
– The company is organized into DEPARTMENTs. Each department
has a name, number and an employee who manages the
department. We keep track of the start date of the department
manager.
– Each department controls a number of PROJECTs. Each project
has a name, number and is located at a single location.
– We store each EMPLOYEE’s social security number, address,
salary, sex, and birthdate. Each employee works for one
department but may work on several projects. We keep track of
the number of hours per week that an employee currently works
on each project. We also keep track of the direct supervisor of
each employee.
– Each employee may have a number of DEPENDENTs. For each
dependent, we keep track of their name, sex, birthdate, and
relationship to employee.

Friday, August 20, 2021 An Introduction to DBMS 53


Example – ER Diagram for COMPANY DB
Alternative ER Notation of Company DB

Friday, August 20, 2021 An Introduction to DBMS 55


UML Class Diagram for COMPANY DB
ER Diagram for Bank DB

Friday, August 20, 2021 An Introduction to DBMS 57


Data Dictionary (MetaData)
DBMS Overall System Structure

Friday, August 20, 2021 An Introduction to DBMS 59


SQL
• Application programs generally access databases
through one of

– Language extensions to allow embedded SQL

– Application program interface (e.g., ODBC/JDBC)


which allow SQL queries to be sent to a database

Friday, August 20, 2021 An Introduction to DBMS 60


SQL
• SQL: widely used non-procedural language

– Example: Find the name of the customer with customer-id


192-83-7465
select customer.customer_name
from customer
where customer.customer_id = ‘192-83-7465’

– Example: Find the balances of all accounts held by the


customer with customer-id 192-83-7465
select account.balance
from depositor, account
where depositor.customer_id = ‘192-83-7465’ and
depositor.account_number =
account.account_number
Friday, August 20, 2021 An Introduction to DBMS 61
DATABASE LANGUAGES
DDL, DML, DCL & TCL commands

Friday, August 20, 2021 An Introduction to DBMS 62


Data Definition Language (DDL)
• Specification notation for defining the database schema
– Example: create table account (
account_number char(10),
– branch_name char(10),
– balance integer)

• DDL compiler generates a set of tables stored in a data dictionary

• Data dictionary contains metadata (i.e., data about data)


– Database schema
– Data storage and definition language
• Specifies the storage structure and access methods used
– Integrity constraints
• Domain constraints
• Referential integrity (e.g. branch_name must correspond to a valid
branch in the branch table)
– Authorization
Friday, August 20, 2021 An Introduction to DBMS 63
Data Manipulation Language (DML)

• Language for accessing and manipulating the data


organized by the appropriate data model
– DML also known as query language

• Two classes of languages


– Procedural – user specifies what data is required and how
to get those data
– Declarative (nonprocedural) – user specifies what data is
required without specifying how to get those data

• SQL is the most widely used query language


Friday, August 20, 2021 An Introduction to DBMS 64
Database Users
• Users are differentiated by the way they expect to interact with
the system

• Application programmers – interact with system through DML


calls

• Sophisticated users – form requests in a database query language

• Specialized users – write specialized database applications that


do not fit into the traditional data processing framework

• Naïve users – invoke one of the permanent application programs


that have been written previously
– Examples, people accessing database over the web, bank
tellers, clerical staff
Friday, August 20, 2021 An Introduction to DBMS 65
Database Administrator
• Coordinates all the activities of the database system
– has a good understanding of the enterprise’s
information resources and needs.

• Database administrator's duties include:


– Storage structure and access method definition
– Schema and physical organization modification
– Granting users authority to access the database
– Backing up data
– Monitoring performance and responding to
changes
• Database tuning
Friday, August 20, 2021 An Introduction to DBMS 66
Data storage and Querying
• Database system is partitioned into modules that
deal with the responsibilities of overall system

• Functional components of a Database System


• Storage manager
• This component is Important because Data
movement to/from disk storage to main
memory is slow relative to CPU speed (Main
memory can’t store large amount of data)
• Query processor
• Important because it helps database simplify
and facilitate access to data
Friday, August 20, 2021 An Introduction to DBMS 67
Storage Management
• Storage manager is a program module that provides the
interface between the low-level data stored in the
database and the application programs and queries
submitted to the system.

• The storage manager is responsible to the following


tasks:
– Interaction with the file manager
– Efficient storing, retrieving and updating of data

• Issues:
– Storage access
– File organization
– Indexing and hashing
Friday, August 20, 2021 An Introduction to DBMS 68
Storage Manager - Components
• Authorization & Integrity Manager
– Tests for satisfaction of integrity constraints
– Checks the authority of users to access data

• Transaction Manager
– Ensures that the DB remains in consistent (correct) state despite system
failures & also concurrent transaction executions

• File Manager
– Manages the allocation of space on disk storage and data structures
used to represent the information on disk

• Buffer Manager
– Fetches data from disk to main memory and decides what data to cache
in main memory
– Critical component since it enables DB to handle large data sizes which
are much larger than main memory
Friday, August 20, 2021 An Introduction to DBMS 69
Query Processor - Components
• DDL Interpreter
– Interprets DDL statements and records definition in the Data
Dictionary

• DML Compiler
– Translates DML statements into an evaluation plan (low level
instructions) which is understood by Evaluation engine
– Query can be translated into many alternatives which give same
result but DML compiler performs Query Optimization to pick
lowest cost alternative

• Query Evaluation Engine


– Executes low level instructions generated by DML compiler
Friday, August 20, 2021 An Introduction to DBMS 70
Query Processing
1. Parsing and translation
2. Optimization
3. Evaluation

Friday, August 20, 2021 An Introduction to DBMS 71


PARSING
• Process of analyzing a string of symbols
– either in natural or in computer languages
– According to the rules of a formal grammar

• Within computer science, the term is used in


the analysis of computer languages, referring
to the syntactic analysis of the input code into
its component parts in order to facilitate the
writing of compilers and interpreters
Friday, August 20, 2021 An Introduction to DBMS 72
Query Processing (Cont.)

• Alternative ways of evaluating a given query


– Equivalent expressions
– Different algorithms for each operation

• Cost difference between a good and a bad way of evaluating a query


can be enormous

• Need to estimate the cost of operations


– Depends critically on statistical information about relations
which the database must maintain
– Need to estimate statistics for intermediate results to compute
cost of complex expressions

Friday, August 20, 2021 An Introduction to DBMS 73


Transaction Management
• A transaction is a collection of operations that
performs a single logical function in a database
application

• Transaction-management component ensures


that the database remains in a consistent (correct)
state despite system failures (e.g., power failures
and operating system crashes) and transaction
failures.

• Concurrency-control manager controls the


interaction among the concurrent transactions, to
ensure the consistency of the database.
Friday, August 20, 2021 An Introduction to DBMS 74
Database Architecture
• The architecture of a database systems is greatly
influenced by the underlying computer system on
which the database is running:

• Centralized
• Client-server
• Parallel (multiple processors and disks)
• Distributed

Friday, August 20, 2021 An Introduction to DBMS 75


Overall System Structure

Friday, August 20, 2021 An Introduction to DBMS 76


Database Application Architectures

(web browser)

Old Modern
Friday, August 20, 2021 An Introduction to DBMS 77
QUERIES???

Friday, August 20, 2021 An Introduction to DBMS 78

You might also like