File Systems and Databases
File Systems and Databases
Database
A database is a collection of related
data or operational data extracted from
any firm or organization. For example,
consider the names, telephone number, and
address of people you know. You may have
recorded this data in an indexed address book,
or you may have stored it on a diskette, using
a personal computer and software such
as Microsoft Access of MS Office or
ORACLE, SQL SERVER etc.
2
Banks
Travel Agents
Data
DBMS
Application
Programs
Importance of DBMS
It helps make data management more
efficient and effective.
It provides end users better access to
more and better-managed data.
It promotes an integrated view of
organizations operations -- big picture.
It reduces the probability of inconsistent
data.
6
Field
Record
File
Field an
Student File
Id No.
1100
1200
1300
1400
Record
1500
all data about
one occurrence
of the entity
(collection of related
fields)
Name
Ali
Bobby
Clement
David
Evelyn
Faculty
FIT
FIT
FCM
FCM
FOE
Major
SE
MIS
MM
MM
CE
individual
characteristic
or attribute
12
File System
FileCritique
System Data Management
File systems require extensive programming
in a third-generation language (3GL).
As the number of files expands, system
administration becomes difficult.
Making changes in existing file structures is
important and difficult.
Security features to safeguard data are
difficult to program and usually omitted.
Difficulty to pool data creates islands of
information.
13
File System
Critique
File System
Critique
15
File System
Critique
16
File System
Critique
FIELD
CONTENTS
CUS_LNAME
CUS_FNAME
CUS_INITIAL
Customer initial
CUS_AREACODE
CUS_PHONE
Customer phone
CUS_ADDRESS
CUS_CITY
Customer city
CUS_STATE
Customer state
17
File System
Critique
Data Redundancy:
Uncontrolled data redundancy sets the
stage for
Data Inconsistency (lack of data integrity)
Data anomalies
Modification anomalies
Insertion anomalies
Deletion anomalies
18
Database
Systems
Database
Systems
Database
Systems
Organizations size
Organizations function
Database
Systems
Database
Systems
The types of Database Systems
Location
Centralized Database
Distributed Database
Use
Transactional (Production)
Decision support
Data warehouse
23
Database
Systems
DBMS Functions
1.Data Dictionary Management
2.Data Storage Management
3.Data Transformation and Presentation
4.Security Management
5.Multi-User Access Control
6.Backup and Recovery Management
7.Data Integrity Management
8.Database Access Languages (DDL and DML) and
Application Programming Interfaces
9.Database Communication Interfaces
24
Database Models
Database Models
Three Types of Relationships
One-to-many relationships (1:M)
A painter paints many different paintings, but each
one of them is painted by only that painter.
PAINTER (1) paints PAINTING (M)
Many-to-many relationships (M:N)
An employee might learn many job skills, and each
job skill might be learned by many employees.
EMPLOYEE (M) learns SKILL (N)
One-to-one relationships (1:1)
Each store is managed by a single employee and
each store manager (employee) only manages a
single store.
EMPLOYEE (1) manages STORE (1)
26
Database Models
Three Types of Implementation
Database Models
Hierarchical database model
Network database model
Relational database model
27
Hierarchical Database
Models
Pointer Based
Linkages Between
Entities
Location
P10
P11
P12
Prof#
J13
M7
D23
Name
Jones
Morgen
Davis
Location Stud#
P200
P201
P202
P203
P204
P205
P206
P207
1234
4678
2943
1874
4017
2318
6021
5503
Office#
SB312
BA218
SB 106
S_name
Smith
Davis
Evans
Allen
Lloyd
Marx
Keen
Watts
Class
Standing
Fr
So
Fr
Jr
Fr
Sr
So
Jr
1st Student
P203
P200
P201
Next
Prof_Stud
P202
P204
P206
P205
*
P207
*
*
Pointers
give
the
physical location of a
related set of data, the
location values
(P10, P201, etc.) in our
example are meant to
represent this type of
physical location. Real
pointers usually
indicate a displacement
in a file. Instead of the
P203 value in the first
professor record
we would see an
indicator
that
the
related data begins at
30
the 4028th byte of the
file that stores student
Location
P200
P201
P202
P203
P204
P205
P206
P207
Jones SB312
Morgen BA218
Davis SB 106
Class
Standin
Stud#
S_name g
1234 Smith
Fr
4678 Davis
So
2943 Evans Fr
1874 Allen
Jr
4017 Lloyd
Fr
2318 Marx
Sr
6021 Keen
So
5503 Watts
Jr
1st Student
P203
P200
P201
Next
Prof_Stud
P202
P204
P206
P205
*
P207
*
*
31
Hierarchical
A hierarchical relationship
is one where each entity at
a lower level of the
hierarchy is related to only
one type of entity at a
higher level of the
hierarchy (a higher level
entity can be linked to two
or more lower level child
entities)
A
B
33
35
Network Relationships
A network relationship is one in
which an entity at a lower level
can be linked to two or more
entities at a higher level.
E.G. - an order is related to
both a customer who placed it
and a salesperson who made
the sale
The hierarchical model does not
support network relationships.
To capture them a second
database would have to be
created and linked to the first.
C
A
36
Repetition of Identifying
Data to Link Related Data
Prof#
J13
M7
D23
Stud#
1234
4678
2943
1874
4017
2318
6021
5503
Name
Jones
Morgen
Davis
Office#
SB312
BA218
SB 106
S_name
Class
Standing
Prof#
Smith
Davis
Evans
Allen
Lloyd
Marx
Keen
Watts
Fr
So
Fr
Jr
Fr
Sr
So
Jr
M7
D23
M7
J13
D23
J13
M7
J13
38
39
Relational Database
Model
- Advantages
Structural independence
Improved conceptual simplicity
Easier database design, implementation,
management, and use
Ad hoc query capability (SQL)
Powerful database management system
Disadvantages
Substantial hardware and system software overhead
Possibility of poor design and implementation
Potential islands of information problems
40
A Relational Schema
41
Entity-Relationship Data
Model
Entity-Relationship Data Model
It is one of the most widely
accepted graphical data modeling
tools.
It graphically represents data as
entities and their relationships in
a database structure.
It complements the relational data
model concepts.
42
Entity-Relationship Data
Model
Entity Relationship Data Model
Basic Structure
E-R models are normally represented in
an entity relationship diagram (ERD).
An entity is represented by a rectangle.
Each entity is described by a set of
attributes. An attribute describes a
particular characteristics of the entity.
A relationship is represented by a
diamond connected to the related
entities.
43
The ER Diagram
44
Entity-Relationship Data
Model
46
49
50
Terminal
Only I/O
done here
Terminal
Only I/O
done here
Central DB
Computer
All processing
related to DB
System done
here
Only I/O
done here
Terminal
Only I/O
done here
Client-Server Database
All data reside on a central server
Core database management processing is
performed on server
Application files and processing to request data,
manipulate results and manage the user
interface is performed on client computers
52
Client Comp
Syntax checks
of SQL stmts.
Manipulation
- presentation
of retrieved
data done here
Server
Computer
All Database
access, retrieval
and, manipulation processes
performed here
Client Comp
Syntax checks
of SQL stmts.
Manipulation
- presentation
of retrieved
data done here
References
ROB, P. AND CORONEL, C., 2004, Database
Systems. 6th Ed., Thomson Course Technology
54