Third Normal Form (3NF)
Third Normal Form (3NF) A relation is said to be in 3NF if it is already in 2NF and it has no transitive dependency. A functional dependency X Y in a relation schema r is a transitive dependency if there is a set of attributes Z that is neither a candidate key nor a subset of any key of the relation and both XZ and ZY holds.
Example The following employee table is not in 3NF because hourly rate is determined by the group and so there is transitive dependency between two non-key attributes Normalized Employee table – Employee table in 3NF. The employee table is split into emp1 and emp2 in 3NF Emp2 Emp1 Rate_group Hourly_Rate A $1000 B $500 Emp_id Employee_name Rate_group 100 Charles A 101 James B 102 Jannifer
Because DeptName is dependent on Dno (has transitive dependent on key) 3NF? PERSON ENO Name Dno DeptName E001 Somchai D01 Physic E003 Somchay D02 Computer Science E004 SomSiri Manipulate easy Update Deptname easy But insert still has problem Answer is No Because DeptName is dependent on Dno (has transitive dependent on key)
Solution Remove the offending attributes Take the determinant along
Result PERSON Department ENO Name Dno Dno DeptName E001 Somchai E003 Somchay D02 E004 SomSiri Dno DeptName D01 Physic D02 Computer Science Manipulate easy Update Deptname easy But insert still has problem
A Relation in 2NF but Not in 3NF Identify primary key (PK) and Look for transitive dependence Transitive dependency 8
Transforming to 3NF Move the attributes involved in transitive dependency to another relation Order Customer 9