DBS211_Lab09_Normalization1
DBS211_Lab09_Normalization1
Lab 09 – Normalization
(UNF, 1NF)
Objective:
Students create the Un-normalized Form (UNF) relation from a user view.
Students identify a Multi-valued Dependency (a.k.a. Repeating Group )
Students create the First Normal Form (1NF) relation from the UNF.
Submission:
Only submit the last section, however it is extremely important that
you you’re your way through it first.
Save your lab file as a PDF file. You need to submit a single PDF
named as DBS211_L09_Group_Number file for this lab.
YOUR NAME AND STUDENT ID MUST BE IN THE PDF document or you
will receive a mark of ZERO.
Definitions:
Definition: Normalization is the process of assigning attributes to relations in such
a way that data redundancies are reduced or eliminated.
Definition: User Views can be individual descriptions, reports, forms, or lists of
data that are required to support the operations of a particular database user.
Definition: Unnormalized form (UNF) is a relation that contains one or more
Multi-valued Dependencies.
Instructions:
Step 1: Create UNF Relation from a User View. The goal here is to create a
single relation for the data found in the user view. The method used is:
Examine the user view
Identify all attributes
Describe the user view using DBDL
Here is an example of a user view. This reports lists the customers of the
Premiere Corporation.
Premiere Corporation Customer List
A. Examine the user view: As you examine this report, you can see that it
contains a title, a line of column headings and the body of the report. Each
line in the body of the report contains data about a particular customer. For
example we can see that in the first line of the body of the report, there is
data about Customer 124. This customer’s name is Sally Adams and she
lives at 482 Oak in Lansing, Michigan (MI). The Sales Representative who
calls on Sally Adams is Sales Rep Number 03.
B. Identify all attributes: The attributes (or characteristics) of a User View
can often be found by simply looking at the column headings. In our
Customer Report we see that we have the following attributes: Customer
Number, Customer Name, Street, City, State, Zip Code and Sales
Representative Number.
C. Describe the relation using DBDL: Database Design Language (DBDL) is a
standardized way of describing relations of a relational database. You
describe a relation by:
a. Choose an appropriate name for the relation. We chose to name our
relation CUSTOMER because each line in the report describes
customer data.
b. List the attributes you found in the user view inside square brackets,
giving each attribute a suitable attribute name. Note: calculated fields
or derived fields should not be included in the DBDL
c. Determine which attribute would be suitable as a primary key and
underline that attribute.
The DBDL for the relation resulting from our Customer user view would look
as follows:
_________________________________________________________________________
________________________________ ________________________________
________________________________ ________________________________
________________________________ ________________________________
_____________________________________________________________________________
DBS211
For example, looking at the following User View, we see that for each Customer
number, it is possible to have multiple values for the order number and order date
attributes. Therefore the order number and date are a multi-valued dependency.
Notice the brackets around the OrderNum and Orderdate attributes. This quickly
and easily identifies a multi-valued dependency to someone who is reading the
DBDL.
The fact that the Customer Number and Name for Sally Adams and Mary Nelson
have been repeated on multiple lines does not make Customer Number and Name
a multi-valued dependency! You should still identify that for one customer number,
there are multiple values for the order number and date. Note that this does not
mean that EVERY customer number will have multiple order numbers, just that this
user view shows that it is possible for some customer numbers to have multiple
values for Order Number and Date. The Multi-valued Dependency must be identified
in the DBDL. Note also that it is possible to have more than 1 multi-valued
dependency.
DBS211
Therefore, the process of taking a relation from UNF to 1NF, involves resolving the
multi-valued dependencies.
Method:
- Choose a primary key for the multi-valued dependancy.
- Identify the primary key of the multi-valued dependancy by
underlining it or writing (PK) .
- Rewrite the DBDL by removing the paranthesis and concatenating
the original primary key with the primary key of the multi-valued
dependency.
- Rewrite the DBDL with the two-part Primary Key and include all
the non-key attributes.
For example, using our previous report from part B, we had the following:
NOTE: If we start with a relation that does not contain any multi-valued
dependencies, it is already in 1NF.
DBS211
Lab 09 Submission:
For the following User View, determine the UNF and the 1NF and hand in
this page to your instructor.
UNF:
1NF: