Professional Documents
Culture Documents
Normalization
Agenda
TopDown vs Bottom Up
What is Normalization?
Why Normalization?
Normalization Steps
Top Down vs Bottom Up
Top Down
Usually provided just a narrative or very high level
data requirements
Need to discover entities, attributes, relationships
Result is tables
Top Down vs Bottom Up
Bottom Up
Provided with views of data
Views can be screen shots or reports (printouts)
PROJ_NAME
EMP_NUM
EMP_NAME
JOB_CLASS
CHG_HOUR
HOURS
First Normal Form
Tabular format in which:
All key attributes are defined
There are no repeating groups in the table
All attributes are dependent on primary key
All
relational tables satisfy 1NF requirements
Some tables contain partial dependencies
Dependencies based on only part of the primary
key
Still subject to data redundancies
EMPLOYEE_PROJECT(PROJ_NUM(PK), EMP_NUM(PK),
PROJ_NAME, EMP_NAME, JOB_CLASS, CHG_HOUR, HOURS)
Conversion to Second Normal
Form
Relationaldatabase design can be improved
by converting the database into second normal
form (2NF)
Two steps
Step 1: Identify All Key Components
Determine which attributes are dependent on
which other attributes
Using the dependency diagram, document the
partial dependencies: in other words take each
part of the primary key and document which
attributes are dependent on each part of the
primary key
Dependency Diagram
1NF 2NF
PROJ_NUM
PROJ_NAME
EMP_NUM
EMP_NAME
JOB_CLASS
CHG_HOUR
HOURS
Step 2: Identify the Dependent
Attributes
Write each key component on separate line,
and then write the original (composite) key on
the last line
Each component will become the key in a new
table
primary key
Conversion to Third Normal Form
Dataanomalies created are easily eliminated
by completing these steps
Step 1: Identify Each New
Determinant
For every transitive dependency, write its
determinant as a PK for a new table
Determinant
Any attribute whose value determines other values within
a row
Using the dependency diagram, document the
transitive dependencies: in other words
identify the attributes dependent on each
determinant identified above and identify the
dependency
Dependency Diagram
1NF 2NF 3 NF
PROJ_NUM
PROJ_NAME
EMP_NUM
EMP_NAME
JOB_CLASS
CHG_HOUR
HOURS
JOB_CLASS is a determinant because
it can determine other values within the
row. In this case, it’s the CHG_HOUR
Step 2: Name the table
Name the table to reflect its contents and
function
EMPLOYEE
PK EMP _NUM
JOB _CLASS
PK JOB _CLASS EMP _LNAME
Has assigned
EMP _FNAME
CHG _HOURS EMP _INITIAL
FK 1 JOB _CLASS
works
EMPLOYEE _PROJECT