Data Structures and Caatt'S For Data Extraction: Maria Keyceelyn Jane L. Maron
Data Structures and Caatt'S For Data Extraction: Maria Keyceelyn Jane L. Maron
9
Relational Database Structure,
Concepts and Terminology
Relational databases are based on the
indexed sequential file structure. This structure
uses an index in conjunction with a sequential
file organization
10
Accordingly, a system is relational if it:
11
The Relational Algebra Functions
Restrict, Project, and Join
12
FIGURE 8-12. Data model using and ERD
Entity, Occurrence, and Attributes
An entity is anything about which the organization
wishes to capture data. Figure 8-12 is an example of
Entity.
15
Four basic forms of cardinality are possible:
17
Properly designed tables possess the following four
characteristics:
25
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
When unnormalized tables are split and
reduced to third normal form, they must
then be linked together by foreign keys.
26
Business Rule 1. Each vendor supplies the
firm with three (or fewer) different items of
inventory, but each item is supplied by only
one vendor.
Business Rule 2. Each vendor supplies the
firm with any number of inventory items, but
each item is supplied by only one vendor.
Business Rule 3. Each vendor supplies the
firm with any number of inventory items, and
each item may be supplied by any number of
vendors.
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.
29
Designing
Relational
Databases
Kresylene R. Torres
Six Phases of database design
(view modeling):
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
Step1. Identify entities.
• Assign primary keys to the entities in the model. The analyst should
select a primary key that logically defines the non key attributed and
uniquely identifies each occurrence in the entity. Sometimes this can be
accomplished using sequential code such as Invoice Number, check
number or purchase order number.
• Every attribute in Ana entity should appear directly or indirectly in one
or more user views. Entity attributes are originally derived and modeled
from user views.
• If stores data are not used in the document, report, or a calculation that
is reported in some way, then it serves no purpose and should not be
part of the database.
Step 4. Normalize Data Model
and add foreign keys
Unnormalized Table
Remove Repeating Groups
Table in First Normal Form (1NF)
Remove Partial Dependencies
Unnormalized Table
Remove Repeating Groups
Table in First Normal Form (1NF)
Remove Partial Dependencies
Unnormalized Table
Remove Repeating Groups
Table in First Normal Form (1NF)
Remove Partial Dependencies
Unnormalized Table
Remove Repeating Groups
Table in First Normal Form (1NF)
Remove Partial Dependencies
Unnormalized Table
Remove Repeating Groups
Table in First Normal Form (1NF)
Remove Partial Dependencies