Normalization Practice Questions
Normalization Practice Questions
Solution:
Unnormalized Table (UNF):
1
UNF to 1NF:
2
Functional Dependencies of the 1NF:
3
1NF to 2NF:
2NF to 3NF:
4
2NF to 3NF:
5
Decomposition from 1NF into 3NF:
Solution:
Here you see that the Movies Rented column has multiple values.
6
• Each record must be unique.
1NF Example:
In our database, there are 3 people with the same name, Robert Phil, and two of them live in
different places.
Therefore, we need both Name and Address to uniquely identify a record. This represents
a Composite Key.
• Be on 1NF
• Single Column Primary Key that does not functionally depend on any subset of the
7
We will carry out the operations to transform our simple database into the 2nd Normalization
Table 1
Table 2
We split our 1NF table into two tables; Table 1 and Table 2.
We added a new column called MEMBERSHIP_ID, which is the Primary Key for Table 1.
Foreign Key references the Primary Key of another Table and helps you connect tables.
8
· A Foreign Key may have a different name than the Primary Key.
· Unlike Primary Key, they do not need to be unique. Most of the time they are not.
· Foreign Key may be empty even if the Primary Key cannot be reset.
A transitive functional dependency can cause changing a non-key column to change any of the
other non-key columns.
9
Consider Table 1. Changing the non-key Name column can change the Salutation column.
• Be in 2NF
To move our 2NF table to our 3NF table, we need to split the table again.
We split our tables again and created a new table that stores the Salutation column.
10
There are no transitive functional dependencies and therefore our table is in 3NF.
The 3rd table contains the SALUTATION_ID Primary_Key and the 1st table contains the
11