You are on page 1of 31

DATABASE

DATABASE
MANAGEMEN
MANAGEMEN
T
T
SYSTEM
SYSTEM
Chapter 9: Part 2
ANOMALIES, STRUCTURAL
DEPENDENCIES, AND DATA
NORMALIZATION
Three Types of Anomalies

Update Insertion Deletion


Anomaly Anomaly Anomaly
A modification on an A new item cannot If an attribute item
attribute must be be added to the table used by one entity is
made in each of the until at least one deleted, all
rows in which the entity uses a information about
attribute appears. particular attribute that attribute item is
item. lost.
Three Types of Anomalies

Update Insertion Deletion


Anomaly Anomaly Anomaly
A modification on an A new item cannot If an attribute item
attribute must be be added to the table used by one entity is
made in each of the until at least one deleted, all
rows in which the entity uses a information about
attribute appears. particular attribute that attribute item is
item. lost.
The Normalization Process
A process which systematically splits
unnormalized complex tables into smaller
tables that meet two conditions:
• all nonkey (secondary) attributes
in the table are dependent on the
primary key.
• all nonkey attributes are
independent of the other nonkey
attributes.
Steps in
Normalization
Process
1. Design the
user view
Example, an output report, a
source document, or an input
screen. It can be prepared
using a word processor, a
graphics package, or simply
pencil and paper.
2. Remove repeating group data
Repeating group
data is the existing
of multiple values
for a particular
attribute in a
specific record.
Example, in the sales
invoice, it contains multiple
values for the attributes
PROD NUM, DESCRIPTION,
QUANTITY, AND UNIT
PRICE.
2. Remove repeating group data

The figure shows the


resulting tables. One is
called Sales Invoice
table, with invoice
num. as the primary
key. The second table
contains the
transaction details for
the invoice and is
called Line Item Table.
3. Remove partial dependencies
A partial dependency
occurs when one or
more nonkey
attributes are
dependent on (defined
by) only part of the
primary key, rather
than the whole key.

This can occur only in


the tables that have
composite (two or
more attribute)
primary keys.
4. Remove transitive dependencies

A transitive
dependency occurs in
a table where nonkey
attributes are
dependent on another
nonkey attribute and
independent of the
table’s primary key.
Linking Normalized tables

When unnormalized tables are split and reduced to third normal form,
they must then be linked together by foreign keys so that the data in
them can be related and made accessible to users.

This requires first determining the cardinality (degree of association,


1:1, 1:M, M:M) between the tables and then assigning foreign keys.
Accountants and Data Normalization
 Update anomalies can generate conflicting and
obsolete database values.
 Insertion anomalies can result in unrecorded
transactions and incomplete audit trails.
 Deletion anomalies can cause the loss of
accounting records and the destruction of audit
trails.
 Accountants should understand the data
normalization process and be able to determine
whether a database is properly normalized.
DESIGNING RELATIONAL
DATABASES
SIX PHASES IN DESIGNING
RELATIONAL DATABASES
2. Construct a data
1. Identify entities model showing entity
associations
● Identify the primary
● Determine the
entities of the
associations
organization.
between entities.
● Construct a data
● Model
model of their
associations into
relationships.
an ER diagram.
SIX PHASES IN DESIGNING
RELATIONAL DATABASES
3. Add primary keys 4. Normalize data
and attributes to the model and add foreign
model keys
● Assign primary keys ● Remove
to all entities in the repeating groups,
model to uniquely partial and
identify records. transitive
● Every attribute should dependencies.
appear in one or ● Assign foreign
more user views. keys to be able to
link tables.
SIX PHASES IN DESIGNING
RELATIONAL DATABASES

5. Construct the 6. Prepare the user


physical database views
● Normalized tables
● Create physical should support all
tables. required views of
● Populate tables with system users.
data. ● User views restrict
users from having
access to
unauthorized data.
DATABASES IN A
DISTRIBUTED
ENVIRONMENT
Distributed Data Processing (DDP)
 Data processing is organized around several information
processing units (IPUs) distributed throughout the organization.
- Each IPU is placed under the control of the end user.

 Typically, DDP’s use a centralized database.

 Alternatively, the database can be distributed, similar to the


distribution of the data processing capability.
Centralized Databases
The data is retained in a central location.
Remote IPUs send request for data.
Central site services the needs of the remote IPUs.
The actual processing of the data is performed at the
remote IPU.
Data Currency Database lockout procedure
Occurs in DDP with are necessary to keep IPUs
centralized database. from reading inconsistent
During transaction data and from writing over a
processing, data will transaction being written by
temporarily be another IPU.
inconsistent as records
are read and updated .
Distributed Databases
Can be distributed using either the partitioned or replicated
technique.
Partitioned Databases
Splits the central database into segments that
are distributed to their primary users.
Advantages:
• users’ control is increased by having data stored at local
sites.
• transaction processing response time is improved
• volume of transmitted data between IPUs are reduced
• reduces the potential data loss from disaster
The Deadlock
Phenomenon
Especially a problem with
partitioned databases.
Occurs when multiple sites
lock each other out of data
that they are currently
using.
Special software is needed
to analyze and resolve the
conflicts.
Distributed Databases
Replicated Databases
The duplication of the entire database for
multiple IPUs.
Effective for situations with a high degree of
data sharing, but no primary user.
• Supports read-only queries
Data traffic between sites is reduced
considerably.
Concurrency Problems and Control Issues

Database concurrency is the presence of complete and


accurate data at all IPU sites.
With replicated databases, maintaining current data at all
locations is difficult.
Time stamping is used to serialize transactions.
- Prevents and resolves conflicts created by
updating data at various IPUs
Distributed databases and the Accountant

The following database options impact the organization’s ability to


maintain database integrity, to preserve audit trails, and to have accurate
accounting records.

 Centralized or distributed data?


 If distributed, replicated or partitioned?
 If replicated, totally or partially replication?
 If partitioned, what allocation of the data segments among the sites?
End of Chapter
Thank you for listening!
Reporters:

Nidar, Krina Chua, Joyce


Isabel Ann
BSA II G1 BSA II G1
Chapter 9: Part 1 Chapter 9: Part 2

You might also like