SyntaxStudy
Sign Up
MySQL Third Normal Form (3NF)
MySQL Intermediate 4 min read

Third Normal Form (3NF)

Third Normal Form

3NF: must be in 2NF, and no transitive dependencies — non-key columns should depend only on the primary key, not on other non-key columns.

Example
-- Violates 3NF: employees table
-- emp_id | name | dept_id | dept_name
-- dept_name depends on dept_id (a non-key column)

-- Fix: separate departments table
CREATE TABLE departments (
  id INT PRIMARY KEY,
  name VARCHAR(100)
);

CREATE TABLE employees (
  id INT PRIMARY KEY,
  name VARCHAR(100),
  dept_id INT REFERENCES departments(id)
);
Pro Tip

If column B determines column C, and B is not the PK, move C to B's own table.