Full answer
In employees(id, name, dept_id, dept_name), the chain is id → dept_id → dept_name. Every Engineering employee repeats 'Engineering'; renaming the department means updating all of them, and a department with no employees cannot be stored.
The fix keeps dept_id in employees and moves the name:
text
employees(id, name, dept_id)
departments(id, name)This is the STAFF sample schema used throughout this bank. A short way to remember 3NF: every non-key column depends on "the key, the whole key, and nothing but the key". 1NF gives a key, 2NF covers "the whole key", and 3NF covers "nothing but the key".
Key points
- Transitive: key → non-key → another non-key
- 3NF = 2NF plus no transitive dependencies
- Move the dependent columns to a table keyed by the middle column
- 'The key, the whole key, and nothing but the key'
Common mistakes
- Calling every repeated value a 3NF violation
- Removing a needed foreign key along with the dependent column
Follow-ups
- How does BCNF differ from 3NF?
- Is storing a city and a postal code together a 3NF problem?
Tips
- Use the employees and departments example