Top-Rated Free Essay
Preview

Normalizaiton in Database

Satisfactory Essays
1773 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Normalizaiton in Database
Normalization of Database Tables

Introduction to
Normalization
of
Database
Tables

Normalization of Database Tables

l

Introduction to
Normalization
of
Database
Tables

4
4
4

ISM 602
Dr. Hamid Nemati

4
4
4

Functional Dependency l Introduction to
Normalization
of
Database
Tables

l

l

A Functional Dependency Is A Relationship Between
Or Among Attributes Such That The Values Of One
Attribute Depend On, Or Are Determined By, The
Values Of The Other Attribute(s).
Partial Dependency: Is A Relationship Between
Attributes Such That The Values Of One Attribute Is
Dependent On, Or Determined By, The Values Of
Another Attribute Which Is Part Of The Composite Key.
Partial Dependencies Are Not Good Due To duplication
Of Data And Update Anomalies;

Examples of Functional Dependencies: l Introduction to
Normalization
of
Database
Tables

l

l

Transitive Dependencies l Introduction to
Normalization
of
Database
Tables

l

Is A Relationship Between Attributes Such That The
Values Of One Attribute Is Dependent On, Or
Determined By, The Values Of Another Attribute
Which Is Not A Part Of The Key.
Exist when a nonkey attribute value is functionally dependent upon another nonkey value in the record. For example: l l l

If we know an ISBN, then we know the Book Title and the author(s) l ISBN è Book Title l ISBN è Author(s)
If we know the VIN, then we know who is the Auto owner l VIN è Auto_Owner
If we know Student-ID (SID), then we can uniquely determine his/her Name l SID è S_Name

So Now what is Normalization? l Introduction to
Normalization
of
Database
Tables

GOLDEN RULE OF NORMALIZATION: Enter The
Minimum Data Necessary, Avoiding Duplicate Entry
Of Information, With Minimum Risks To Data
Integrity.

l

Goals Of Normalization: u Eliminate Redundancies Caused By: l EMPLOYEE_ID --> JOB_CATEGORY
JOB_CATEGORY --> HOURLY_RATE

An employee data table that includes the “hourly pay rate” would require searching every employee record to properly update an hourly rate for a particular job category. Objectives
The idea of Dependencies of Attributes
Normalization and Database Design
Understand concepts of normalization
(Higher-Level Normal Forms)
Learn how to normalize tables
Understand normalization and database design issues
Denomalization

l l u u u

Fields Repeated Within A File
Fields Not Directly Describing The Key Entity
Fields Derived From Other Fields

Avoid Anomalies In Updating (Adding, Editing,
Deleting)
Represent Accurately The Items Being Modeled
Simplify Maintenance And Retrieval Of Info

Basic Rule for Normalization

Database Tables and Normalization l Introduction to
Normalization
of
Database
Tables

l

Normalization is a process for assigning attributes to entities. It reduces data redundancies and helps eliminate the data anomalies.
Normalization works through a series of stages called normal forms: u u u l

l
Introduction to
Normalization
of
Database
Tables

First normal form (1NF)
Second normal form (2NF)
Third normal form (3NF)

u

l l l

l l EM_SS_NUM --> EM_NAME

Corollaries u The highest level of normalization is not always desirable. Facilitates data integration.
Reduces data redundancy.
Provides a robust architecture for retrieving and maintaining data.
Compliments data modeling.
Reduces the chances of data anomalies occurring. A relationship is functionally dependent when one attribute value implies or determines the attribute value for the other attribute. l l

u

Normalization Benefits

Introduction to
Normalization
of
Database
Tables

The attribute values in a relational table should be functionally dependent (FD) on the primary key value.

Corollary 1: No repeating groups allowed in relational tables.
Corollary 2: A relational table should not have attributes involved in a transitive dependency relationship with the primary key.

Database Tables and Normalization l The Need for Normalization u Introduction to
Normalization
of
Database
Tables

Case of a Construction Company l l l Building project -- Project number, Name, Employees assigned to the project.
Employee -- Employee number, Name, Job classification
The company charges its clients by billing the hours spent on each project. The hourly billing rate is dependent on the employee’s position.

Deletion Anomaly

Database Tables and Normalization l Introduction to
Normalization
of
Database
Tables

Problems with the Table 5.1 u u u u

The project number is intended to be a primary key, but it contains nulls.
The table displays data redundancies.
The table entries invite data inconsistencies.
The data redundancies yield the following anomalies: l l l

Update anomalies.
Addition anomalies.
Deletion anomalies.

l
Introduction to
Normalization
of
Database
Tables

l

Occurs when the removal of a record results in a loss of important information about an entity.
Example:
l

l

All the information about a customer is contained in an order file, if the order is canceled, all the customer information could be lost when the order record is deleted

Solution: l Create two tables--one table contains order information and the other table contains customer information.

Update Anomaly l Introduction to
Normalization
of
Database
Tables

l

Occurs when a change of a single attribute in one record requires changes in multiple records
Example:
uA

staff person changes their telephone number and every potential customer that person ever worked with has to have the corrected number inserted. l

Insertion Anomaly l Introduction to
Normalization
of
Database
Tables

l

Occurs when there does not appear to be any reasonable place to assign attribute values to records in the database. Probably have overlooked a critical entity.
Example:
u Adding

new attributes or entire records when they are not needed. Where do you place information on new Evaluator’s? Do you create a dummy
Lead.

Solution: u Put

the employees telephone number in one location--as an attribute in the employee table.

l

Solution: u Create

a new table with a primary key that contains the relevant or functional dependent attributes. Database Tables and Normalization l Conversion to First Normal Form u Introduction to
Normalization
of
Database
Tables

Database Tables and Normalization

u

A relational table must not contain repeating groups.
Repeating groups can be eliminated by adding the appropriate entry in at least the primary key column(s). (See Database Table 5.3)

l

Dependency Diagram u Introduction to
Normalization
of
Database
Tables

u

The arrows above the entity indicate that the entity’s attributes are dependent on the combination of
PROJ_NUM and EMP_NUM.
The arrows below the dependency diagram indicate less desirable dependencies based on only a part of the primary key -- partial dependencies.

Database Table 5.2 The Evergreen Data
Figure 5.1 A Dependency Diagram: First Normal Form

Database Tables and Normalization l Introduction to
Normalization
of
Database
Tables

Database Tables and Normalization

1NF Definition u The term first normal form (1NF) describes the tabular format in which: l l l All the key attributes are defined.
There are no repeating groups in the table.
All attributes are dependent on the primary key.

l
Introduction to
Normalization
of
Database
Tables

Conversion to Second Normal Form u Starting with the 1NF format, the database can be converted into the 2NF format by l l

Writing each key component on a separate line, and then writing the original key on the last line and
Writing the dependent attributes after each new key.

PROJECT (PROJ_NUM, PROJ_NAME)
EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS,
CHG_HOUR)
ASSIGN (PROJ_NUM, EMP_NUM, HOURS)

Database Tables and Normalization l 2NF Definition u Introduction to
Normalization
of
Database
Tables

Database Tables and Normalization

A table is in 2NF if: l l

u

It is in 1NF and
It includes no partial dependencies; that is, no attribute is dependent on only a portion of the primary key. l

Conversion to Third Normal Form u Introduction to
Normalization
of
Database
Tables

PROJECT (PROJ_NUM, PROJ_NAME)
ASSIGN (PROJ_NUM, EMP_NUM, HOURS)
EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS)
JOB (JOB_CLASS, CHG_HOUR)

Note:
It is still possible for a table in 2NF to exhibit transitive dependency; that is, one or more attributes may be functionally dependent on nonkey attributes.

u

See figure 5.2 page 290.

Database Tables and Normalization l Normalization and Database Design

3NF Definition u Introduction to
Normalization
of
Database
Tables

Create a separate table with attributes in a transitive functional dependence relationship.

A table is in 3NF if: l l

It is in 2NF and
It contains no transitive dependencies.

l
Introduction to
Normalization
of
Database
Tables

Database Design and Normalization Example:
(Construction Company) u Summary of Operations: l l l l

l

l

Normalization and Database Design l Introduction to
Normalization
of
Database
Tables

Normalization and Database Design

Two Initial Entities:
PROJECT (PROJ_NUM, PROJ_NAME)
EMPLOYEE (EMP_NUM, EMP_LNAME, EMP_FNAME,
EMP_INITIAL, JOB_DESCRIPTION,
JOB_CHG_HOUR)

Figure 5.7 The Initial E-R Diagram for a Contracting Company

The company manages many projects.
Each project requires the services of many employees.
An employee may be assigned to several different projects.
Some employees are not assigned to a project and perform duties not specifically related to a project. Some employees are part of a labor pool, to be shared by all project teams.
Each employee has a (single) primary job classification.
This job classification determines the hourly billing rate.
Many employees can have the same job classification.

l
Introduction to
Normalization
of
Database
Tables

Three Entities After Transitive Dependency
Removed
PROJECT (PROJ_NUM, PROJ_NAME)
EMPLOYEE (EMP_NUM, EMP_LNAME, EMP_FNAME,
EMP_INITIAL, JOB_CODE)
JOB (JOB_CODE, JOB_DESCRIPTION,
JOB_CHG_HOUR)

Normalization and Database Design

Normalization and Database Design l Introduction to
Normalization
of
Database
Tables

Creation of the Composite Entity ASSIGN

Introduction to
Normalization
of
Database
Tables

Figure 5.8 The Modified E-R Diagram for a Contacting Company
Figure 5.9 The Final (Implementable) E-R Diagram for the Contracting Company

Normalization and Database Design l Introduction to
Normalization
of
Database
Tables

l

Attribute ASSIGN_HOUR is assigned to the composite entity ASSIGN.
“Manages” relationship is created between
EMPLOYEE and PROJECT.

Normalization and Database Design

Introduction to
Normalization
of
Database
Tables

PROJECT (PROJ_NUM, PROJ_NAME, EMP_NUM)
EMPLOYEE (EMP_NUM, EMP_LNAME, EMP_FNAME,
EMP_INITIAL, EMP_HIREDATE, JOB_CODE)
JOB (JOB_CODE, JOB_DESCRIPTION,
JOB_CHG_HOUR)
ASSIGN (ASSIGN_NUM, ASSIGN_DATE, PROJ_NUM,
EMP_NUM, ASSIGN_HOURS)

Figure 5.10 The Relational Schema for the Contracting Company

Summary
A Journey of Normalization
Introduction to
Normalization
of
Database
Tables

First Normal Form
(1NF)

Remove
“Repeating Groups”

Second Normal Form
(2NF)

Remove
“Partial Functional
Dependency”

Denormalization

Third Normal Form
(3NF)

Remove
“Transitive Functional
Dependency”

Higher order Normal
Forms

Remove
“All Remaining Functional
Dependency”

l
Introduction to
Normalization
of
Database
Tables

l l Normalization is only one of many database design goals. Normalized (decomposed) tables require additional processing, reducing system speed.
Normalization purity is often difficult to sustain in the modern database environment. The conflict between design efficiency, information requirements, and processing speed are often resolved through compromises that include denormalization.

You May Also Find These Documents Helpful

  • Good Essays

    Nt1310 Unit 1 Quiz

    • 1980 Words
    • 8 Pages

    6 . For an unconditional approach to a particular part of a complex PL/SQL block, which of the following control structures can be used?…

    • 1980 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    PT2520 Week 3 Forum

    • 190 Words
    • 1 Page

    Normalization process you and will need to examine a business application. In this case you need to explore the simplified database activities of a company that manages several building projects each project has its own project number, names of employees assigned to it and so on. Each employee has an employee number, name and job classification such as engineer or computer technician.…

    • 190 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Nt1320 Unit 7

    • 2041 Words
    • 9 Pages

    The database design team transforms entities into tables and expresses relationships by defining foreign keys. The tables in the model are to be normalized before converting them into designs. Normalization is the process of converting poorly structured tables into two or more well-structured tables. Database practitioners classify tables into various normal forms according to the kinds of problems they have. Transforming a table into a normal form to remove duplicated data and other problems is called normalizing the table. After normalizing, the designer should represent the relationship among those tables to complete the design.…

    • 2041 Words
    • 9 Pages
    Good Essays
  • Satisfactory Essays

    The Entity Relationship Diagram, also known as (ERD) demonstrates the relationship between data in the new database. ERD shows the logical path that the data follows. The data model gives one understanding and the visual representation to observe the different phases of the database and determine the path the information is pulled or stored from. Learning Team D demonstrate linking the different tables in the Fleet Truck Maintenance database. The creation of the logical path predicts the flow of the data entered and the tables relationship to other tables in the database.…

    • 553 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    This memo is to inform you that your service request SR-ta-001 has reached my desk and currently is in the process of being completed. The purpose of this memo is to report the progress on the service requests. Currently I am in the stage of normalizing the database to the third normal form. By normalizing the database to the third level of normalization I will ensure that the data is efficiently organized within the database by removing duplicate and redundant data from the database relations. Normalizing the data to the normal third will help free up space and make it easier for the users to retrieve the data by elimination of the same data stored in more than one relation. In addition, normalizing to this level will also ensure data integrity, scalability, and storage efficiency. I have made sure that that there are no repeating columns or rows within the same tables and each column has only one value and one data type therefore the level of 1 normalization has been completed. I then continued to normalize the database to the second level of normalization by ensuring that each nonkey attribute is fully dependent on the key columns of the table. Once level one and two normal form had been completed I continued by establishing primary and foreign keys along with relationships. I will keep in contact with you as the project nears completion.…

    • 329 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Database

    • 504 Words
    • 4 Pages

    Copy and paste the specified ipconfig /all command output from the Windows CLI into the Task 1 box provided below.…

    • 504 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Anime LIst

    • 11441 Words
    • 52 Pages

    Which of the following defines a relationship in which each occurrence of data in one entity…

    • 11441 Words
    • 52 Pages
    Good Essays
  • Good Essays

    c1 sols

    • 1005 Words
    • 6 Pages

    8. List the steps of the normalization process. First, a primary key is identified and any repeating groups are identified. Then any partial dependencies are eliminated. Finally, any transitive dependencies are eliminated.…

    • 1005 Words
    • 6 Pages
    Good Essays
  • Better Essays

    Database Design

    • 1196 Words
    • 5 Pages

    “A database is a structured collection of records or data that is stored in a computer system. In order for a database to be truly functional, it must not only store large amounts of record, but also be able to access those records fast and efficiently. In addition, new information and changes should also be easy to input.” (tech-faq.com) To be useful over a long term the database should be able to store all the records necessary for the business to function as well as be able to get all of this information back in case of a system failure or a crash. If all the information is loss a business could go bankrupt so the database is a fail safe for all the information the company has.…

    • 1196 Words
    • 5 Pages
    Better Essays
  • Best Essays

    The selected database I have chosen for this project will be that of a veterinary medical supply database and the veterinarians who order medications from that database. I will track what is ordered and shipped to the veterinarians. This is an online veterinary supply, so, all medications will be mailed (or shipped) to the customer with a…

    • 3587 Words
    • 15 Pages
    Best Essays
  • Good Essays

    Databases are defined as: a usually large collection of data organized especially for rapid search and retrieval (as by a computer). Without databases the world of technology wouldn’t be as far along as it is. Databases are used in every organization, online websites, home computer systems, and other various ones. The contents of this paper will analyze the use of Modernized Integrated Database (MIDB) within L3 Communications, Titan’s, Product Support Team (PST) in reference to Global Command and Control Systems-Maritime (GGCS-M).…

    • 758 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    To end up with a good ‘relational database’ application, you need to ask: Do I actually need one? If so, how far do you want to take it? By this I mean, is this to be a simple database to store information about only one, or very few, related entities (i.e. a list of people who attended a certain event, and how they came to hear about the event) which are not likely to change; or a permanent and well used application with several different entities (i.e. Staff, Departments, Branches, SalesFigures for various periods/staff members/departments) which are constantly changing. If the forma is the case, a simple ‘Flat File’ database is all that is required. There are several basic database products on the market that will fully service this requirement but all that is needed is a table in MS Word for Windows or a basic Spreadsheet application, such as MS Excel. If the later is the case, then a Relational Database is needed. Although there are many products on the market, they have several common features and all use some form of SQL (Structured Query Language) to build, edit and query the database.…

    • 2594 Words
    • 11 Pages
    Powerful Essays
  • Good Essays

    Database Design

    • 418 Words
    • 2 Pages

    Before you use Microsoft Access to actually build the tables, forms, and other objects that will make up your database, it is important to take time to design your database. A good database design is the keystone to creating a database that foes what you want it to do effectively, accurately, and efficiently.…

    • 418 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Database concepts

    • 586 Words
    • 3 Pages

    In relational database theory, a functional dependency is a constraint between two sets of attributes in a relation from a database.…

    • 586 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Database

    • 797 Words
    • 3 Pages

    1) Which account is designated as the owner of a relation? What privileges does the owner of a relation have?…

    • 797 Words
    • 3 Pages
    Good Essays