A-Level Computer Science / Unit 8: Relational Databases and SQL

8.1.7 Normalisation: Third Normal Form

πŸ”’ Lesson slides are available to signed-in users. Sign in

8.1.7 Normalisation: Third Normal Form

Third Normal Form (3NF) requires 2NF and removes transitive dependencies between non-key attributes.

By the end of this page, you should be able to:

  • define and use the key terms accurately;
  • explain how the idea works using a new example;
  • apply the idea to a database design or SQL task.

1. Check 2NF before 3NF

A table must first satisfy 1NF and 2NF. Then inspect whether a non-key field determines another non-key field. This can happen even when the primary key has only one field.

2. Trace the dependency chain

Suppose StaffID identifies BranchCode, and BranchCode identifies BranchPhone. StaffID therefore determines BranchPhone through BranchCode. BranchPhone depends on another non-key field rather than directly on the staff key.

3. That pattern is transitive dependency

A transitive dependency exists when a key determines a non-key field through another non-key field. Repeating branch details in many staff records can lead to inconsistent phone numbers after a branch change.

4. Separate the branch facts

Create Branch(BranchCode, BranchPhone). Keep BranchCode as a foreign key in Staff. Now the branch phone is stored with the branch it describes, and each staff row can still identify its branch.

Worked example

Staff(StaffID PK, BranchCode, BranchPhone) becomes Staff(StaffID PK, BranchCode FK) and Branch(BranchCode PK, BranchPhone).

Common mistake to avoid

A 3NF explanation needs a dependency, not just a comment that a value repeats. Identify the key and explain the non-key-to-non-key link.

Interactive check

Choose an answer, read the explanation, and continue to the next example.

Try it

Check your understanding

Question 1 of 3
Score: 0 / 3

Independent practice

Try this original question before opening the suggested response.

Vehicle(VehicleID, DepotID, DepotLocation) uses VehicleID as its key. DepotLocation is determined by DepotID. Explain why it is not 3NF and show the change. (4)

Suggested response

VehicleID determines DepotID, and DepotID determines DepotLocation. DepotID is a non-key field determining another non-key field, so there is a transitive dependency. Create Depot(DepotID PK, DepotLocation) and retain DepotID as a foreign key in Vehicle.

Answering clearly

Use the technical term, state what it does, and connect your explanation to the details in the question.