Database Systems
Lecture 2
Dr. Abid Sohail Bhutta
abidbhutta@cuilahore.edu.pk
Department of Computer Science,
COMSATS University , Lahore Campus
2
Lecture 2
File Processing Systems vs Database
Management Systems
3
4
Invoice
Ord
er N
o. 1
No. 0
0
01
S
t
er
eo
sT
oG
o
D
a
t
e: 6
1
/59
/3
A
c
c
ou
nt
No. 1
0
05
-2
5
94
1-
2
C
u
s
to
m:W
e
r i
l
li
am
Te
ll
A
d
dr
es
s: 2
0
36
-2
6S
tr
e
et
S
a
cr
am
e
nt
oCA9
58
1
9
C
i
t
y S
t
at
eZi
pCo
d
e
D
a
t
eSh
i
pp
e:6
d 1
/89
/3
I
t
em Pr
od
uc
t
N
umr C
b
e o
de P
r
od
uc
tDe
s
cr
i
pt
io
n/
Man
u
fa
ct
ur
er y P
Q
t r
i
ce
1S
A
GX
73
0Pi
o
ne
er
Re
mo
t
eA/
VR
ec
e
iv
er15
69
9
5
2A
T
10 Ce
r
vw
in
Ve
ga
Lo
ud
s
pe
ak
e
rs 13
59
9
5
3C
D
PC
72
5So
n
yDi
s
c-
Jo
c
ke
yC
DCh
a
ng
er13
99
9
5
4
5
Anatomy of an Invoice Invoice
Invoice No.
Invoice
Stereos To Go
Date: / /
Account
No.
Customer
Customer:
Address:
City State Zip Code
Invoice Date Shipped: / /
Item Product
Number Code Product Description/Manufacturer Qty Price
1
2
Items 3
purchased on 4
5
the Invoice
Products and Manufacturers
Traditional File-Based System
Definition:
"A collection of application programs that perform
services for the end-users such as the production of
reports. Each program defines and manages its own
data."
Customer Operating
Inventory Vendors Payroll
transactions expenses
Program Program Program Program Program
Report Report Report Report Report
One file, one application
Traditional File-Based System
Customer Invoices
Invoice Program
Orders
“A collection of application programs that perform services for the end users such
as the production of reports. Each program defines and manages its own data.”
Customer Customer Account Account
Accounts Program Report
File
Customer Mailings Mailing
Customer
Program List
Mailing
List
File-Based Systems
Records contain logically related data
Limitations:
Separation and isolation of data (one file, one
program)
Duplication of data
Loss of data integrity - uncertainty of the correct version of
data and no consistency
Data dependence - application program defines the
data
Incompatibility of file formats
Fixed queries of application programs - little flexibility
in meeting changing information needs
Data Redundancy
Customer Order File
Invoice number
Customer account number
Customer name, address, city, state, zip code
Order date
Product code, product description, price, unit
Customer Account File
Account Number
Customer name, mailing address, city, state, zip code
Customer Mailing List File
Customer name, mailing address, city, state, zip code
Data Abstraction
Separation between the data’s structure
(definition) and the application programs
COBOL
Tightly binds the data
FD Master-File. file and program
01 Master-Record.
05 ID PIC X(10).
05 Customer-Fname PIC X(25).
.
.
.
Data Abstraction
Separation between the data’s structure
(definition) and the application programs
COBOL
Tightly binds the data
FD Master-File. file and program
01 Master-Record. Data
05 ID PIC X(10). Output
05 Customer-Fname PICProgram
X(25).
.
.
.
Data Abstraction
Separation between the data’s structure
(definition) and the application programs
Application programs can be run on
either the clients or server
Applications
Data and Data
Definitions
DBMS
Central
Repository
Organizing Data
Entity - distinct object (i.e., person, place,
thing, concept or event)
Attribute - describes some aspect of the
entity (object)
Property of the entity
Relationship - association between entities
Entity Entity
Customers Purchases
Account_number Invoice_number
Attributes Name Account_number
Address Purchase_date
Relationship
Stereos to Go Database
Managemen
t Queries
Customer
Orders
Application
Order Items DBMS
Programs
Products
Manufacturers • DDL
• DML
Other
• Controlled access
Central Repository Software
(Organizational resource)
Single Access Point Multitude of
Applications
Components of a Database
Environment
Hardware
Software: DBMS, application program and query
software
Data: Organized in a schema, partitioned into
subschemas
Procedures: Govern the design, access and use
of the database
People: Administrators (DA, DBA), designers
(logical and physical), application developers
and users (novice and high-powered)
Advantages of the Database Approach
Control of data redundancy
Data consistency
Greater informational gain, more information
from the same amount of data
Sharing data, organizational resource (i.e.,
shared resource)
Improved data integrity, validity and consistency
Improved access and security
Enforcement of standards
Advantages of the Database Approach
Economy of scale, centralization and consolidation
Balancing of conflicting requirements, DBA oversees
data and data definitions
Improved data accessibility and responsiveness
Increased productivity
Improved maintenance through data independence
Increased concurrency
Improved backup and recovery services
Disadvantages of the Database
Approach
Complexity
Dedication of resources including technology
Size and people infrastructures
Cost of DBMS
Additional hardware costs
Cost of conversion
Performance
Higher impact of failure
In a production environment, processing can be
slow