Database Management System
Database Management System
Management System
Group 1
Flat-File Versus Database Environments
Computer processing involves two components: data
and instructions (programs).
Conceptually, there are two methods for designing
interface between programs and data:
file-oriented (flat-file) processing: A specific data
file was created for each application [legacy
systems]
data-oriented processing: Create a single data
repository to support numerous applications
[current systems]
Disadvantages of file-oriented processing include
redundant data and programs and varying
formats for storing the redundant data.
File-Oriented (Flat-File) Environment
User 1(Sales) Data
Transactions
Program 1 A,B,C
User 2 (A/R)
Transactions
Program 2
X,B,Y
User 3 (Payroll)
Transactions
Program 3
L,B,M
Where B is a customer record. Assume Bs address changes. Each user
that works with the B record must modify the address, increasing chance
for error.
Database Approach
User 1 (Sales) Database
Transactions
Program 1
A,
User 2 (A/R)
D
B,
Transactions B
C,
Program 2 M
X,
S
Y,
User 3 (Payroll)
Transactions L,
Program 3 M
With the database approach, any User could change Bs address - it would be
changed for all users. changes. [Assume all users have authority to change
the
Data Redundancy & Flat-File
Problems
Data Storage - creates excessive storage
costs of paper documents and/or magnetic
form
Data Updating - any changes or
additions must be performed multiple
times (see example of Bs address)
Currency of Information - potential
problem of failing to update all affected
files
Task-Data Dependency - users inability
to obtain additional information as his or
her needs change
Data sharing/centralized database resolves
flat-file problems:
No data redundancy - Data stored only once,
eliminating data redundancy and reducing storage
costs.
Single update - Because data are in only one place,
requires only single update procedure, reducing
time/cost of keeping database current.
Current values - Change to database made by any
(authorized) user yields current data values for all
other (authorized) users.
Task-data independence - As users information
needs expand beyond immediate domain, new needs
can be more easily satisfied than under flat-file
approach
The Database Management System
Three conceptual mode
Hierarchical Model
Network Model
Relational Model
Data Model
- is the blueprint for ultimately
creating the physical database.
Payme
nt
Entity, Occurrence, and Attributes
Occurrence
- is used to describe the number
of instances or records that
pertain to a specific entity.
Attributes
- are the data elements that
define an entity.
Associations and Cardinality
The labeled line connecting two
entities in a data model
describes the nature of the
association between them.
Associations and
Cardinality
Cardinality
- is the degree of association between
two entities.
4 basic forms:
0, 1
1,1
0,M
1,M
Cardinality Notation
Crows foot
Write the cardinal values on
each end of the association line
connecting the two entities
Physical Database Tables
Four characteristics of properly designed tables:
The value of at least one attribute in each
occurrence must be unique, which is the primary
key. Other attributes need not to be unique.
All attribute values in any column must be of the
same class.
Each column in a given table must be uniquely
named. However, different tables may contain
columns with the same name.
Tables must conform to the rules of
normalization.
Linkages Between
Relational Tables
Foreign keys
- physically connect related
tables to achieve the
associations described in the
data model.
Linkages Between Relational Tables
User Views
- the set of data that a particular
user sees.
1. Identify Entities
2. Construct a data model showing entity
associations
3. Add primary keys and attributes to the model
4. Normalize the data model and add foreign
keys
5. Construct the physical database
6. Prepare the user views.
1. Identify Entities
To pass as valid entities, two
conditions need to be met:
Updates Contains
Inventory
Supplies
0, 0,
M:M M:M
M:M
Supplier Sent
to
1: 0,
M
Receiving Is Purchase
Report associated Order
1: 1
with
Add Primary Keys and Attributes to the
Model
Prepare the user views
normalize tables should support
all required views of system users
- To Illustrate, consider the computer logic for recording the credit sale of
P2,000 to customer James
Partitioned Database
- Splits the central database into segments or
partitions that are distributed to their primary users.
The advantage of this approach are:
Concurrency Control