DBMS
Data: known facts that can be recorded. Ex 89
Information : Processed form of data which is
meaningful .ex : Marks =89
Database- collection of related data
1
BASIC DEFINITIONS
Database Management System (DBMS): A
software system used to create and maintain
database.
Database System: The DBMS software having
data . Sometimes, the applications are also
included.
DATABASE MANAGEMENT SYSTEM (DBMS)
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 3
DATA BASE AND DATA BASE USERS 4
Users/Programmers
DATABASE
SYSTEM Application Programmer / Queries
DBMS
SOFTWA Software to Process
RE Queries/Programs
data
Software to access stored data
Stored4
Stored
database
database
(metadata)
Figure1.1:A simplified database system environment ,illustrating the concepts
and terminology discussed in section 1.1.
DBMS FUNCTIONALITY
Define a database : in terms of data
types, structures and constraints
Construct or Load the Database on a
secondary storage medium
Manipulating the database : querying,
generating reports, insertions, deletions
and modifications to its content
Concurrent Processing and Sharing
by a set of users and programs – yet,
keeping all data valid and consistent
EXAMPLE OF A DATABASE
(WITH A CONCEPTUAL DATA MODEL)
Mini-worldfor the example: Part of a
UNIVERSITY environment.
Some mini-world entities:
STUDENTs
COURSEs
SECTIONs (of COURSEs)
(academic) DEPARTMENTs
INSTRUCTORs
Note: The above could be expressed in the
ENTITY-RELATIONSHIP data model.
FILES BASED SYSTEM DISADVANTAGES
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
Security problems
Hard to provide user access to some, but not all, data
7
MAIN CHARACTERISTICS OF THE
DATABASE APPROACH
Self-describing nature of a database system:
A DBMS catalog stores the description of
the database. The description is called meta-
data). This allows the DBMS software to
work with different databases.
Insulation between programs and data:
Called program-data independence.
Allows changing data storage structures and
operations without having to change the
DBMS access programs.
MAIN CHARACTERISTICS OF THE
DATABASE APPROACH
Data Abstraction: A data model is
used to hide storage details and present
the users with a conceptual view of the
database.
Support of multiple views of the data:
Each user may see a different view of
the database, which describes only the
data of interest to that user.
Sharing of data and multiuser
transaction processing :
3-TIER ARCHITECTURE
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;
External view level: application programs hide
details of data types. Views can also hide
information (such as an employee’s salary) for
security purposes.
10
VAn
IEW OF DATA
architecture for a database system
11
INSTANCES AND SCHEMAS
Schema – overall description of the database
ex: cust_id : string;
cust_name : string;
cust_street : string;
cust_city : string;
2 Types of schema :
Physical schema: database design at the physical
level
Logical schema: database design at the logical
level
Instance – the actual content of the database at a
particular point in time 12
DATA INDEPENDENCE
Physical Data Independence – the ability to
modify the physical schema without changing the
logical schema
Logical Data Independence- the ability to
modify the logical schema without changing the
external view
13
RELATIONAL MODEL
Attributes
Example of tabular data in the relational model
14
A SAMPLE RELATIONAL DATABASE
15
THE ENTITY-RELATIONSHIP MODEL
It is collection of entities and relationships
Entity: real life “object” in the enterprise
Relationship: an association among several entities
Represented diagrammatically by an entity-
relationship diagram:
16
SQL
SQL: widely used non-procedural language
Example: Find the name of the customer with customer-id
192-83-7465
select cust_name
from customer
where cust_id = ‘192’
Example: Find the balances of all accounts held by the
customer with customer-id 192-83-7465
select balance
from depositor, account
where cust_id = ‘192’
17
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
18
DATA MANIPULATION LANGUAGE (DML)
Language for :
accessing
manipulating the data
SQL is the most widely used query language
19
DATABASE USERS
Actors on the scene
Database administrators(DBA):
responsible for authorizing access to the
database, for co-ordinating and monitoring
its use, acquiring software, and hardware
resources, controlling its use and monitoring
efficiency of operations.
Casual: access database occasionally
when needed
CATEGORIES OF END-USERS
Naïve or Parametric : they know
little about Dbms and databases.
Sophisticated : these include business
analysts, scientists, engineers, others
thoroughly familiar with the system
capabilities..
ADVANTAGES OF USING THE DATABASE
APPROACH
Controlling redundancy in data storage and in
development and maintenence efforts.
Sharing of data among multiple users.
Restricting unauthorized access to data.
Providing persistent storage for program Objects
(in Object-oriented DBMS’s –
Providing Storage Structures for efficient Query
Processing
Slid
e 1-
22
ADVANTAGES OF USING THE DATABASE
APPROACH
Providing backup and recovery services.
Providing multiple interfaces to different
classes of users.
Representing complex relationships among
data.
Enforcing integrity constraints on the
database.
Drawing Inferences and Actions using rules
DATA MODELS
Relational Model:-
Collection of tables to represent data & relationship among
those data.
Each table has multiple columns.
Each column has a unique name.
Figure 1.3: - Bank Customers
Name SSN Address City Account Number
A 1 X L 7
B 2 Y P 8
C 3 Z Q 9
D 4 M R 10
E 5 N S 11
F 6 O T 12
A 1 X L 13
24
NETWORK MODEL: -
Data Records
Relationship Links(Viewed as pointer)
Records in the database are arranged as
collection of arbitrary graph.
25
HIERARCHICAL MODEL:
Similar to network model in the sense of records &
links.
Organized as collection of trees rather than graph.
26