L-1 Introduction (New) DBMS
L-1 Introduction (New) DBMS
1
Course outcomes:
Student would be able to
Parul Saxena
and characteristics embodied in database systems.
CO3:Design principles for logical design of
databases, including the E‐R method and
normalization approach.
CO4:Evaluate database storage structures and
access techniques
CO5:Identify the issues of transaction processing
and concurrency control.
CO6:Analyze an information storage problem and
derive an information model expressed in the form of
an entity relation diagram and other optional
analysis forms, such as a data dictionary. 2
CHAPTER 1: INTRODUCTION
Purpose of Database Systems
View of Data
Parul Saxena
Data Definition Language
Data Manipulation Language
Transaction Management
Storage Management
Database Administrator
Database Users
Overall System Structure
3
DATABASE MANAGEMENT SYSTEM (DBMS)
Parul Saxena
enterprise or business or project.
DBMS provides 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
Manufacturing: production, inventory, orders, supply chain
Human resources: employee records, salaries, tax deductions
Databases touch all aspects of our lives 4
PURPOSE OF DATABASE SYSTEM
Parul Saxena
Multiple file formats, duplication of information in different files
data redundancy can cause data inconsistency, which can
provide a company with unreliable and/or meaningless
information.
Difficulty in accessing data
Need to write a new program to carry out each new task
Data isolation — multiple files and formats
One of the goals of isolation is to allow multiple transactions to occur at
the same time without adversely affecting the execution of each other.
Integrity problems
Integrity constraints (e.g. account balance > 0) become part of
program code
Hard to add new constraints or change existing ones 5
PURPOSE OF DATABASE SYSTEMS (CONT.)
Parul Saxena
E.g. 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
E.g. two people reading a balance and updating it at the same
time
Security problems
Database systems offer solutions to all the above
problems
6
LEVELS OF ABSTRACTION
Physical level describes how a record (e.g.,
customer) is stored.
Parul Saxena
Logical level: describes data stored in database,
and the relationships among the data. Structure
and constraints for the entire database.
type customer = record
name : string;
street : string;
city : integer;
end;
View level: application programs hide details of
data types. Views can also hide information (e.g.,
salary) for security purposes. 7
VIEW OF DATA
An architecture for a database system
Parul Saxena
8
INSTANCES AND SCHEMAS
Similar to types and variables in programming languages
Schema – the logical structure of the database
e.g., the database consists of information about a set of customers and
accounts and the relationship between them
Type information of a variable in a program
Physical schema: database design at the physical level
Parul Saxena
Logical schema: database design at the logical level
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.
Change of Location of Database from say C drive to D Drive
Using a new storage device like Hard Drive or Magnetic Tapes
Logical Data Independence - Logical Data Independence is mainly
concerned with the structure or changing the data definition. 9
Add/Modify/Delete a new attribute, entity or relationship is possible without a rewrite of
existing application programs
Logical Data Independence Physical Data Independence
Logical Data Independence is mainly Mainly concerned with the storage of the
concerned with the structure or changing data.
the data definition.
Parul Saxena
You need to make changes in the A change in the physical level usually
Application program if new fields are does not need change at the Application
added or deleted from the database. program level.
10
DATA DEFINITION LANGUAGE (DDL)
Parul Saxena
account-number 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
language in which the storage structure and access methods
used by the database system are specified
11
Usually an extension of the data definition language
A SAMPLE RELATIONAL DATABASE
Parul Saxena
12
DATA MANIPULATION LANGUAGE (DML)
Language for accessing and manipulating the
data organized by the appropriate data model
Parul Saxena
DML also known as query language
Two classes of languages
Procedural – user specifies what data is required and how to
get those data
Nonprocedural – user specifies what data is required without
specifying how to get those data
SQL is the most widely used query language
13
SQL
SQL: widely used non-procedural language
E.g. find the name of the customer with customer-id 192-83-7465
select customer.customer-name
from customer
Parul Saxena
where customer.customer-id = ‘192-83-7465’
E.g. 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
14
DATABASE USERS
Users are differentiated by the way they expect to
interact with the system
Application programmers – interact with system
through DML calls. They are the back end
programmers who writes the code for the application
Parul Saxena
programs.
Sophisticated users – form requests in a database
query language. They are engineers, scientists,
business analyst, who are familiar with the database.
They can develop their own database applications
according to their requirement.
Naive users – invoke one of the permanent
application programs that have been written
previously
E.g. people accessing database over the web, bank tellers, clerical
staff. They don’t have any DBMS knowledge but they still use the 15
database and perform their given task.
DATABASE ADMINISTRATOR
Coordinates all the activities of the database
system; the database administrator has a
Parul Saxena
good understanding of the enterprise’s
information resources and needs.
Database administrator's duties include:
Schema definition
Storage structure and access method definition
Schema and physical organization modification
Granting user authority to access the database
Specifying integrity constraints
Monitoring performance and responding to changes in
requirements
16
TRANSACTION MANAGEMENT
A transaction is a collection of operations that
performs a single logical function in a database
Parul Saxena
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.
17
STORAGE MANAGEMENT
Storage manager is a program module that
provides the interface between the low-level data
Parul Saxena
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
18
SYSTEM STRUCTURE
Parul Saxena
19
DATA MODELS
A collection of tools for describing
data
data relationships
data semantics
Parul Saxena
data constraints
Entity-Relationship model
Relational model
Other models:
object-oriented model
Older models: network model and hierarchical model
20
ENTITY RELATIONSHIP MODEL (CONT.)
E-R model of real world
Entities (objects)
Parul Saxena
E.g. customers, accounts, bank branch
Relationships between entities
E.g. Account A-101 is held by customer Johnson
Relationship set depositor associates customers with
accounts
Widely used for database design
Database design in E-R model usually converted to design in
the relational model which is used for storage and processing
21
ENTITY-RELATIONSHIP MODEL
Example of schema in the entity-relationship model
Parul Saxena
22
RELATIONAL MODEL
Attributes
Example of tabular data in the relational model
Customer- customer- customer- customer- account-
id name street city number
Parul Saxena
192-83-7465 Johnson Alma Palo Alto A-101
019-28-3746 Smith North Rye A-215
192-83-7465 Johnson Alma Palo Alto A-201
321-12-3123 Jones Main Harrison A-217
019-28-3746 Smith North Rye A-201
23
DBMS SCHEMA
11/7/2021
Definition of schema: Design of a database is called the
schema. Schema is of three types: Physical schema,
24
The design of a database at physical level is
called physical schema, how the data stored in blocks of
storage is described at this level.
11/7/2021
Design of database at logical level is called logical
schema, programmers and database administrators work
11/7/2021
database. Database schema defines the variable
declarations in tables that belong to a particular database;
the value of these variables at a moment of time is called