You are on page 1of 4

ITEC 65 - ADVANCED DATABASE MANAGEMENT SYSTEM

Normalization

Usually involves dividing large table into smaller (less redundant) tables and defining
relationships between them.
Develop by E.F. Codd in 1972.

1NF

Vocabulary
Primary Key – unique identifier
Non-Key Attributes – children of the primary key
Determinant – attribute to find out values assigned to other attributes in the same row
Dependent – look to the primary key for reference

Determinant Dependents
b,c -> A
Primary Key A Non-Key b Non-Key c
Unique Attribute A Attribute b Attribute c
Unique Attribute A Attribute b Attribute c

Requirements
 Identify a unique primary key
 Have just one set of values per column
 Have just one set values per cell
 Eliminate repeating data

Hints
-in almost all cases when a table is normalized, it is broken into more than one table
-it is very important to identify the relationships between the parent and child tables

1nf Common Errors

cust_id First_Name Order cust_id First_Name Order


1 John 600 1 John 600,638,2025
1 John 638 4 Ribbon 675,518
1 John 2025
4 Ribbon 675
4 Ribbon 518
ITEC 65 - ADVANCED DATABASE MANAGEMENT SYSTEM

Un-Normalize

EmployeeID First_Name Last_Name AssignmentID BeginDate


101 Jef Hinkle 2 2011-01-15
4 2011-01-16
6 2011-01-17

Normalize
AssignmentID EmployeeID First_Name Last_Name BeginDate
2 101 Jef Hinkle 2011-01-15
4 101 Jef Hinkle 2011-01-16
6 101 Jef Hinkle 2011-01-17

Another Example
ClientRental

clientNo cName propertyNo pAddress rentStart rentFinish rent ownerNo oName


cr76 John PG4 Address1 2012-01-01 2012-12-31 350 CO40 Tina
PG16 Address2 2012-01-01 2012-12-31 450 CO93 Tony
cr56 Aline PG4 Address1 2013-01-01 2013-12-31 350 CO40 Tina
PG36 Address3 2013-01-01 2013-12-31 375 CO93 Tony
PG16 Address2 2013-01-01 2013-12-31 450 CO93 Tony

Client
clientNo cName
CR76 John
CR56 Aline

PropertyRentalOwner
clientNo propertyNo pAddress rentStart rentFinish rent ownerNo oName
cr76 PG4 Address1 2012-01-01 2012-12-31 350 CO40 Tina
cr76 PG16 Address2 2012-01-01 2012-12-31 450 CO93 Tony
cr56 PG4 Address1 2013-01-01 2013-12-31 350 CO40 Tina
cr56 PG36 Address3 2013-01-01 2013-12-31 375 CO93 Tony
cr56 PG16 Address2 2013-01-01 2013-12-31 450 CO93 Tony
ITEC 65 - ADVANCED DATABASE MANAGEMENT SYSTEM

2NF

Vocabulary
Composite Key – made of > 1 column
Partial Dependency – non-key that depends on part of the Composite Key

Composite Key Dependents


e->A whereas c,d -> AB
Primary Key A Primary Key B Non-Key c Non-Key d Non-Key e
Determinant A Determinant B Attribute c Attribute d Attribute e
Determinant A Determinant B Attribute c Attribute d Attribute e

Requirements
 Is in 1NF
 Eliminate Partial Dependency
 Non-Key columns must depend on all keys of the composite key

Hints
-If the Primary Key is made up of a single column, it is guaranteed to be in 2NF
-If a non-key column is related to just one of the columns in the composite key, it partially depends on
the whole key and needs to be in separate table.

Refer to the 1NF table


Client Rental
clientNo cName clientNo propertyNo rentStart rentFinish
CR76 John cr76 PG4 2012-01-01 2012-12-31
CR56 Aline cr76 PG16 2012-01-01 2012-12-31
cr56 PG4 2013-01-01 2013-12-31
cr56 PG36 2013-01-01 2013-12-31
cr56 PG16 2013-01-01 2013-12-31

PropertyOwner
propertyNo pAddress rent ownerNo oName
PG4 Address1 350 CO40 Tina
PG16 Address2 450 CO93 Tony
PG36 Address3 375 CO93 Tony
ITEC 65 - ADVANCED DATABASE MANAGEMENT SYSTEM

3NF

Vocabulary
Composite Primary Key – made of > 1 column
Transitive Relationship – non-key is dependent to another non-key

Composite Key Dependents


e->d whereas c,d -> AB
Primary Key A Primary Key B Non-Key c Non-Key d Non-Key e
Determinant A Determinant B Attribute c Attribute d Attribute e
Determinant A Determinant B Attribute c Attribute d Attribute e

Requirements
 Is in 1NF
 Is in 2NF
 Eliminate transitive dependencies

Hints
-If a non-key attribute directly depends on another non-key attribute, then there is a transitive
dependency
-If attributes do not contribute to a description of the key, remove them to a separate table

Refer to 2NF table


Client Rental
clientNo cName clientNo propertyNo rentStart rentFinish
CR76 John cr76 PG4 2012-01-01 2012-12-31
CR56 Aline cr76 PG16 2012-01-01 2012-12-31
cr56 PG4 2013-01-01 2013-12-31
cr56 PG36 2013-01-01 2013-12-31
cr56 PG16 2013-01-01 2013-12-31

PropertyForRent Owner
propertyNo pAddress rent ownerNo ownerNo oName
PG4 Address1 350 CO40 CO40 Tina
PG16 Address2 450 CO93 CO93 Tony
PG36 Address3 375 CO93

Summary

You might also like