Professional Documents
Culture Documents
Database
Management
Systems
Objectives for Chapter 3
• Operational problems inherent in the flat file approach to
data management that gave rise to the database
concept
• The relationships among the defining elements of the
database environment
• The anomalies caused by unnormalized databases and
the need for data normalization
• The stages in database design including entity
identification, data modeling, constructing the physical
database, and preparing user views
• The operational features of distributed databases and
recognize the issues that need to be considered in
deciding on a particular database configuration
Flat-File Versus Database
Environments
• Computer processing involves two components: data
and instructions (programs).
• Conceptually, there are two methods for designing the
interface between program instructions and data:
– file-oriented processing: A specific data file was
created for each application
– data-oriented processing: Create a single data
repository to support numerous applications.
• Disadvantages of file-oriented processing include
redundant data and programs and varying formats for
storing the redundant data.
• The format for similar fields may vary because the
programmer used inconsistent field formats.
Flat-File Environment
User 1 Data
Transactions
Program 1 A,B,C
User 2
Transactions
Program 2
X,B,Y
User 3
Transactions
Program 3
L,B,M
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
• Currency of Information - potential problem of
failing to update all affected files
• Task-Data Dependency - user’s inability to
obtain additional information as his or her
needs change
Database Approach
User 1
Database
Transactions
Program 1
A,
User 2
D B,
Transactions B C,
Program 2 M X,
S Y,
User 3 L,
Transactions M
Program 3
Advantages of the
Database Approach
Data sharing/centralize database resolves flat-file problems:
No data redundancy - Data is stored only once, eliminating
data redundancy and reducing storage costs.
Single update - Because data is in only one place, it
requires only a single update procedure, reducing the time
and cost of keeping the database current.
Current values - A change to the database made by any
user yields current data values for all other users.
• Task-data independence - As users’ information needs
expand beyond their immediate domain, the new needs can
be more easily satisfied than under the flat-file approach.
Disadvantages of the
Database Approach
• Can be costly to implement
– additional hardware, software, storage, and
network resources are required
• Can only run in certain operating
environments
– may make it unsuitable for some system
configurations
• Because it is so different from
the file-oriented approach, the database
approach requires training users
– may be inertia or resistance
Elements of the Database Approach
Database
System Development Administrator
Process
Applications
User DBMS
Transactions
Programs Data
Definition Host
U Language Operating
S Transactions User System
Data
E Programs Manipulation
R Language
S Transactions User
Query
Programs Language Physical
Database
User Queries
DBMS Features
• User Programs - makes the presence of the DBMS
transparent to the user
• Direct Query - allows authorized users to access
data without programming
• Application Development - user created
applications
• Backup and Recovery - copies database
• Database Usage Reporting - captures statistics on
database usage (who, when, etc.)
• Database Access - authorizes access to sections of
the database
Internal Controls and DBMS
• The purpose of the DBMS is to provide
controlled access to the database.
• The DBMS is a special software system
programmed to know which data
elements each user is authorized to
access and deny unauthorized
requests of data.
Data Definition Language
(DDL)
• DDL is a programming language used to define
the database to the DBMS.
• The DDL identifies the names and the relationship of
all data elements, records, and files that constitute
the database.
• Viewing Levels:
– internal view - physical arrangement of records
(1)
– conceptual view - representation of database (1)
– user view - the portion of the database each user
views (many)
Data Manipulation Language
(DML)
• DML is the proprietary programming
language that a particular DBMS uses to
retrieve, process, and store data.
• Entire user programs may be written in
the DML, or selected DML commands
can be inserted into universal programs,
such as COBOL and FORTRAN.
Query Language
• The query capability permits end users
and professional programmers to access
data in the database without the need for
conventional programs.
• ANSI’s Structured Query Language
(SQL) is a fourth-generation language
that has emerged as the standard query
language.
Functions of the DBA
Logical Data Structures
• A particular method used to organize records
in a database is called the database’s
structure.
• The objective is to develop this structure
efficiently so that data can be accessed
quickly and easily.
• Four types of structures are:
– hierarchical (aka the tree structure)
– network
– relational
– object-oriented
The Relational Model
• The relational model portrays data in the
form of two dimensional tables:
– relation - the database table
– attributes (data elements) - form columns
– tuples (records) - form rows
– data - the intersection of rows and columns
RESTRICT - filtering out rows, PROJECT - filtering out columns,
such as the yellow such as the green
JOIN
X1 Y1 Y1 Z1 X1 Y1 Z1
X2 Y2 Y2 Z2 X2 Y2 Z2
X3 Y1 Y3 Z3 X3 Y1 Z1
Properly Designed Relational Tables
(1:1)
(1:0,M)
(1:M)
(M:M)
Relational Model Data
Linkages (>1 table)
• No explicit pointers are present. The data are viewed as a
collection of independent tables.
• Relations are formed by an attribute that is common to both
tables in the relation.
• Assignment of foreign keys:
– if 1 to 1 association, either of the table’s primary key may
be the foreign key.
– if 1 to many association, the primary key on one of the
sides is embedded as the foreign key on the other side.
– if many to many association, may embed foreign keys or
create a separate linking table.
Three Types of Anomalies
Central Centralized
Site Database
A,B
E, F
C,D