Removing Transitively-dependent Columns (Normalizing the Database)
Go Up to Normalizing the Database
The third step in the normalization process is to remove any non-key columns that depend upon other non-key columns. Each non-key column must be a fact about the primary key column. For example, suppose we added TEAM_LEADER_ID and PHONE_EXT to the PROJECT table, and made PROJ_ID the primary key. PHONE_EXT is a fact about TEAM_LEADER_ID, a non-key column, not about PROJ_ID, the primary key column.
PROJ_ID
|
TEAM_LEADER_ID
|
PHONE_EXT
|
PROJ_NAME
|
PROJ_DESC
|
PRODUCT
|
|---|---|---|---|---|---|
|
DGPII |
44 |
4929 |
Automap |
blob data |
hardware |
|
VBASE |
47 |
4967 |
Video database |
blob data |
software |
|
HWRII |
24 |
4668 |
Translator upgrade |
blob data |
software |
To normalize this table, we would remove PHONE_EXT, change TEAM_LEADER_ID to TEAM_LEADER, and make TEAM_LEADER a foreign key referencing EMP_NO in the EMPLOYEE table.
PROJ_ID
|
TEAM_LEADER
|
PROJ_NAME
|
PROJ_DESC
|
PRODUCT
|
|---|---|---|---|---|
|
DGPII |
44 |
Automap |
blob data |
hardware |
|
VBASE |
47 |
Video database |
blob data |
software |
|
HWRII |
24 |
Translator upgrade |
blob data |
software |
EMP_NO
|
LAST_NAME
|
FIRST_NAME
|
DEPT_NO
|
JOB_CODE
|
PHONE_EXT
|
SALARY
|
|---|---|---|---|---|---|---|
|
24 |
Smith |
John |
100 |
Eng |
4968 |
64000 |
|
48 |
Carter |
Catherine |
900 |
Sales |
4967 |
72500 |
|
36 |
Smith |
Jane |
600 |
Admin |
4800 |
37500 |