Explain, using functional dependencies, why a given set of database tables are, or are not, in Third Normal Form (3NF).
Key Concepts
Functional Dependency (FD): For attributes X and Y in a relation R, X → Y means that if two tuples have the same values for X, they must also have the same values for Y.
Candidate Key: A minimal set of attributes that uniquely identifies a tuple in a relation.
Prime Attribute: An attribute that is part of any candidate key.
Third Normal Form (3NF): A relation R is in 3NF if, for every non‑trivial FD X → Y in R, at least one of the following holds:
X is a superkey of R, or
Y is a prime attribute (i.e., part of some candidate key).
Example Scenario
Consider a university database that stores information about courses, lecturers, and the rooms in which courses are taught.
The only non‑trivial FD has a left‑hand side that is a candidate key, so the relation satisfies 3NF.
Conclusion: LECTURER is in 3NF.
Table 3 – ENROLLMENT
Attribute
Data Type
StudentID
VARCHAR(10)
CourseID
VARCHAR(10)
Semester
VARCHAR(6)
Grade
CHAR(2)
Functional Dependencies
{StudentID, CourseID, Semester} → Grade
Analysis of ENROLLMENT
Candidate Key: {StudentID, CourseID, Semester}.
The only FD has the candidate key on the left‑hand side, so the table is in 3NF.
Conclusion: ENROLLMENT is in 3NF.
Summary Checklist for 3NF
Identify all functional dependencies.
Determine all candidate keys.
For each FD X → Y, verify that X is a superkey or Y is a prime attribute.
If any FD violates the rule, decompose the table until all resulting tables satisfy 3NF.
Suggested diagram: Decomposition of COURSEOFFERING into COURSEOFFERING (CourseID, Semester, LecturerID, RoomNumber) and ROOM (RoomNumber, Capacity) to achieve 3NF.