Normalization is one of those words that makes database design sound harder than it is. Strip away the jargon and it’s a simple habit: store each fact in one place only.
Below, one badly designed table gets fixed step by step, through first, second and third normal form (1NF, 2NF and 3NF). You don’t need to memorise formal definitions. If you can follow the example, you understand normalization.
Beginner · 10 min read · Works in MySQL, SQL Server and PostgreSQL
Quick answer: what is database normalization?
Normalization is a way of organising tables so that each fact is stored only once. You do it in steps called normal forms:
1NF: one value in each cell.
2NF: every column depends on the whole key.
3NF: every column depends on nothing but the key.
The result is more, smaller tables that are linked by keys, and data that can’t contradict itself.

Table of Contents
Why duplicated data causes problems
Imagine a small training centre that tracks course enrolments in a spreadsheet, and someone imports it straight into a database:
| student_id | student_name | student_phone | courses | teacher | teacher_phone |
|---|---|---|---|---|---|
| 1 | Ali | 3300 1111 | SQL Basics, Excel | Mona, Karim | 3911 2222, 3922 3333 |
| 2 | Noor | 3300 4444 | SQL Basics | Mona | 3911 2222 |
| 3 | Hassan | 3300 5555 | Excel, Python | Karim, Rami | 3922 3333, 3933 6666 |
It looks fine at first. Then real life happens:
- Update problem: Mona changes her phone number. You have to find and fix it in every row she appears in. Miss one and your data now disagrees with itself.
- Insert problem: You hire a new teacher who has no students yet. There’s nowhere to put her, because every row needs a student.
- Delete problem: Noor leaves and you delete her row. If she was the only student in a course, you’ve just lost the record that the course existed.
Normalization exists to remove these three problems, which are usually called update, insert and delete anomalies.
A table like this, with lists stuffed into cells, is said to be in unnormalized form (UNF, sometimes written 0NF). It is the starting point before 1NF.
First normal form (1NF): one value per cell
The rule for 1NF is that every cell holds a single value, and there are no repeating groups of columns like course1, course2, course3.
Our table breaks this rule. The courses cell for Ali holds two courses. You can’t easily ask “who is taking Excel?” without messy text searches.
The fix is to give each student-course pair its own row:
| student_id | student_name | student_phone | course | teacher | teacher_phone |
|---|---|---|---|---|---|
| 1 | Ali | 3300 1111 | SQL Basics | Mona | 3911 2222 |
| 1 | Ali | 3300 1111 | Excel | Karim | 3922 3333 |
| 2 | Noor | 3300 4444 | SQL Basics | Mona | 3911 2222 |
| 3 | Hassan | 3300 5555 | Excel | Karim | 3922 3333 |
| 3 | Hassan | 3300 5555 | Python | Rami | 3933 6666 |
Now every cell is simple and searchable. The primary key for this table is the combination of student_id and course. But look how much is repeated. Ali’s phone appears twice and Mona’s appears twice. We’ve fixed one problem and made the duplication worse. That’s normal. The next steps deal with it.
Second normal form (2NF): depend on the whole key
A table is in 2NF when it’s in 1NF and every non-key column depends on the whole primary key, not just part of it.
Our key is (student_id, course). Ask yourself about each column:
- Does
student_namedepend on the student and the course? No, only on the student. - Does
teacherdepend on both? No, only on the course (in this centre, each course has one teacher).
When a column only depends on part of the key, it belongs in its own table. So we split:
students
| student_id | student_name | student_phone |
|---|---|---|
| 1 | Ali | 3300 1111 |
| 2 | Noor | 3300 4444 |
| 3 | Hassan | 3300 5555 |
courses
| course | teacher | teacher_phone |
|---|---|---|
| SQL Basics | Mona | 3911 2222 |
| Excel | Karim | 3922 3333 |
| Python | Rami | 3933 6666 |
enrollments
| student_id | course |
|---|---|
| 1 | SQL Basics |
| 1 | Excel |
| 2 | SQL Basics |
| 3 | Excel |
| 3 | Python |
Each student’s phone is now stored once. Each course is stored once. The enrollments table just links the two together.
Third normal form (3NF): no facts about other facts
A table is in 3NF when it’s in 2NF and no non-key column depends on another non-key column. People sometimes call this removing transitive dependencies.
Look at the courses table. teacher_phone isn’t really a fact about the course. It’s a fact about the teacher. If Karim taught three courses, his phone would be repeated three times, and we’re back to the update problem.
So teachers get their own table:
teachers
| teacher_id | teacher_name | teacher_phone |
|---|---|---|
| 10 | Mona | 3911 2222 |
| 11 | Karim | 3922 3333 |
| 12 | Rami | 3933 6666 |
courses
| course_id | course_name | teacher_id |
|---|---|---|
| 100 | SQL Basics | 10 |
| 101 | Excel | 11 |
| 102 | Python | 12 |
We also swapped the course name for a proper course_id. Names change and ids don’t. That means enrollments now stores the id too:
enrollments
| student_id | course_id |
|---|---|
| 1 | 100 |
| 1 | 101 |
| 2 | 100 |
| 3 | 101 |
| 3 | 102 |
The teacher_id in courses is a foreign key. If that idea is new to you, read Primary Keys vs. Foreign Keys Explained first.
Our final design has four small tables: students, teachers, courses and enrollments. When Mona changes her number, you update one row. When a new teacher joins, you add her to teachers without needing a student. When Noor leaves, the course still exists.
The final design in SQL
Here are the four tables as real CREATE TABLE statements. The primary keys stop duplicate rows, and the foreign keys stop links that point to nothing, for example an enrolment for a course that doesn’t exist.
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100) NOT NULL,
student_phone VARCHAR(20)
);
CREATE TABLE teachers (
teacher_id INT PRIMARY KEY,
teacher_name VARCHAR(100) NOT NULL,
teacher_phone VARCHAR(20)
);
CREATE TABLE courses (
course_id INT PRIMARY KEY,
course_name VARCHAR(100) NOT NULL UNIQUE,
teacher_id INT NOT NULL,
CONSTRAINT fk_courses_teachers
FOREIGN KEY (teacher_id) REFERENCES teachers (teacher_id)
);
CREATE TABLE enrollments (
student_id INT NOT NULL,
course_id INT NOT NULL,
CONSTRAINT pk_enrollments PRIMARY KEY (student_id, course_id),
CONSTRAINT fk_enrollments_students
FOREIGN KEY (student_id) REFERENCES students (student_id),
CONSTRAINT fk_enrollments_courses
FOREIGN KEY (course_id) REFERENCES courses (course_id)
);
Fill them with the data from the example:
INSERT INTO students VALUES (1, 'Ali', '3300 1111'), (2, 'Noor', '3300 4444'), (3, 'Hassan', '3300 5555');
INSERT INTO teachers VALUES (10, 'Mona', '3911 2222'), (11, 'Karim', '3922 3333'), (12, 'Rami', '3933 6666');
INSERT INTO courses VALUES (100, 'SQL Basics', 10), (101, 'Excel', 11), (102, 'Python', 12);
INSERT INTO enrollments VALUES (1, 100), (1, 101), (2, 100), (3, 101), (3, 102);
This works as written in SQL Server, MySQL and PostgreSQL. Notice the primary key of enrollments: it’s the pair (student_id, course_id), so the database itself refuses to enrol Ali in SQL Basics twice. Now, when Mona gets a new phone number, it’s one small update:
UPDATE teachers
SET teacher_phone = '3911 9999'
WHERE teacher_id = 10;
Every course and every student linked to Mona sees the new number straight away, because there was only ever one copy of it.
You can watch the primary key do its job. Try to enrol Ali in SQL Basics a second time:
INSERT INTO enrollments VALUES (1, 100);
The database refuses:
- MySQL:
ERROR 1062: Duplicate entry '1-100' for key 'PRIMARY' - SQL Server:
Msg 2627: Violation of PRIMARY KEY constraint 'pk_enrollments'. Cannot insert duplicate key in object 'dbo.enrollments'. - PostgreSQL:
duplicate key value violates unique constraint "pk_enrollments"
How to spot normalization problems in your own tables
You don’t need to remember the formal rules to find trouble. Look at a table and ask yourself these five questions. A “yes” to any of them usually means part of the table belongs somewhere else.
- Does any cell hold a list? Commas, slashes or “and” inside one value (“SQL Basics, Excel”) break 1NF.
- Are there numbered columns?
phone1,phone2,phone3is a list wearing a disguise. It should be rows in a separate table. - Would one change mean editing many rows? If a teacher’s new phone number has to be typed in several places, it’s stored in too many places.
- Can you add a new thing without inventing a fake row? If you can’t save a new teacher until she has a student, the teacher needs her own table.
- Would deleting one row lose something else? If removing the last student also removes the only record of a course, the course needs its own table.
1NF vs 2NF vs 3NF: the rules side by side
There’s an old line database people like to quote: every column should depend on “the key, the whole key, and nothing but the key.”
| Normal form | The rule in plain English | What it fixes |
|---|---|---|
| 1NF | One value per cell, no repeating columns | Lists stuffed into cells |
| 2NF | Columns depend on the whole key | Data that only belongs to part of a composite key |
| 3NF | Columns depend on nothing but the key | Facts about other columns (like a teacher’s phone in a course table) |
There are higher normal forms too (BCNF, 4NF, 5NF), but for most business applications, getting to 3NF is the sensible target.
What about BCNF?
You’ll sometimes see BCNF (Boyce-Codd Normal Form) mentioned as “3.5NF”. It’s a slightly stricter version of 3NF that only matters in unusual tables where more than one set of columns could act as the key and those sets overlap. In everyday designs like ours, a table in 3NF is almost always in BCNF too, so you can safely treat 3NF as your goal and leave BCNF for later.
Getting the data back together with JOIN
A fair question at this point: if the data is split into four tables, how do I see it all at once? With a JOIN:
SELECT s.student_name, c.course_name, t.teacher_name, t.teacher_phone
FROM enrollments e
JOIN students s ON s.student_id = e.student_id
JOIN courses c ON c.course_id = e.course_id
JOIN teachers t ON t.teacher_id = c.teacher_id
ORDER BY s.student_name, c.course_name;
Result, after Mona’s phone update above:
| student_name | course_name | teacher_name | teacher_phone |
|---|---|---|---|
| Ali | Excel | Karim | 3922 3333 |
| Ali | SQL Basics | Mona | 3911 9999 |
| Hassan | Excel | Karim | 3922 3333 |
| Hassan | Python | Rami | 3933 6666 |
| Noor | SQL Basics | Mona | 3911 9999 |
Mona’s new number appears on both of her rows, even though it was changed in one place.
This rebuilds the original wide view whenever you need it, but the data underneath is stored cleanly. See SQL JOINs Explained Simply if joins are still new to you.
When not to normalize (too much)
Normalization is the right default for systems where data is entered and changed all the time, like accounting, stock control or HR. But it isn’t a religion.
- Reporting and analytics databases are often deliberately denormalized so reports need fewer joins and run faster.
- Historical snapshots are sometimes meant to be copies. An invoice should keep the price the customer paid, even if the product price changes later.
- Splitting too far (a separate table for every tiny attribute) makes queries painful without any real benefit.
The rule I follow: normalize first, then denormalize on purpose only when you have a specific, measured reason.
Practice: normalize this orders table
The best way to make this stick is to try it yourself. Here’s a table a small shop keeps for its orders. Before you read the answer, decide which tables you would split it into.
| order_id | order_date | customer_name | customer_city | product | unit_price | quantity |
|---|---|---|---|---|---|---|
| 5001 | 2026-03-02 | Sara | Manama | Keyboard | 15.000 | 2 |
| 5001 | 2026-03-02 | Sara | Manama | Mouse | 8.000 | 1 |
| 5002 | 2026-03-03 | Yousif | Muharraq | Keyboard | 15.000 | 1 |
Hints: the key here is (order_id, product). Which columns describe the whole order, which describe the customer, and which describe the product?
Show the answer
- customers (
customer_id,customer_name,customer_city): the city is a fact about the customer, not the order (3NF). - products (
product_id,product_name,list_price): one row per product. - orders (
order_id,order_date,customer_id): the date and customer depend only on the order, not the product (2NF). - order_lines (
order_id,product_id,quantity,unit_price): one row for each product on each order.
Did you notice that unit_price stays in order_lines even though products has a price too? That’s on purpose. The order must remember the price Sara actually paid, even if the shop raises the keyboard price next month. It’s the “historical snapshot” case from the section above, and a good example of knowing when a copy is the right answer.
As CREATE TABLE statements:
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100) NOT NULL,
customer_city VARCHAR(50)
);
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100) NOT NULL,
list_price DECIMAL(10,3) NOT NULL
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
order_date DATE NOT NULL,
customer_id INT NOT NULL,
CONSTRAINT fk_orders_customers
FOREIGN KEY (customer_id) REFERENCES customers (customer_id)
);
CREATE TABLE order_lines (
order_id INT NOT NULL,
product_id INT NOT NULL,
quantity INT NOT NULL,
unit_price DECIMAL(10,3) NOT NULL, -- the price on the day of the order
CONSTRAINT pk_order_lines PRIMARY KEY (order_id, product_id),
CONSTRAINT fk_order_lines_orders
FOREIGN KEY (order_id) REFERENCES orders (order_id),
CONSTRAINT fk_order_lines_products
FOREIGN KEY (product_id) REFERENCES products (product_id)
);
This is exactly how the free ShopDB sample database is built: Customers, Products, Orders and OrderItems, with the price kept on each order line. Load it and look at the tables to see a full 3NF design you can query.
Frequently asked questions
What is 0NF (unnormalized form)?
0NF, or UNF, is a table before any normalization: cells that hold lists, repeating columns like phone1 and phone2, and the same facts copied across rows. The very first table in this article is an example. Moving it to 1NF is always the first step.
What is the difference between 2NF and 3NF?
2NF is about the key: a column must depend on the whole key, not just part of it. It only matters when the key has more than one column. 3NF is about other columns: a column must not depend on another non-key column, like teacher_phone depending on teacher. A quick way to remember it: 2NF removes partial dependencies, 3NF removes “facts about facts”.
Does normalization make queries slower?
Usually not by enough to notice. Joining a few well-indexed tables is something databases do very fast. A normalized design is often faster to update, because each change touches one row instead of many. If a big report does become slow, you can add indexes or a reporting table later, as described in SQL Indexes Explained Simply.
What is denormalization?
Denormalization means copying some data on purpose, after you have normalized, to make reading easier or faster. Reporting databases and data warehouses do it all the time. The key words are “on purpose”: you know where the copies are and how they’re kept up to date.
Is normalization still important with NoSQL databases?
Document databases like MongoDB often store related data together in one document, which is a form of denormalization. The thinking behind normalization still helps, though: you need to know which data is copied and what happens when it changes. For most business systems with orders, invoices and stock, a normalized relational database is still the safest choice. See Types of Databases Explained for how the options compare.
Summary
- Normalization means each fact is stored in one place, so it cannot disagree with itself.
- 1NF: one value per cell, no repeating columns.
- 2NF: every column depends on the whole key (only matters with a composite key).
- 3NF: no column depends on another non-key column. Move “facts about facts” to their own table.
- Use JOINs to put the data back together, and denormalize later only on purpose, for example to keep the price paid on an order.
-- 1NF: one row per student and course, not 'SQL Basics, Excel' in one cell
-- 2NF: split out columns that depend on part of the key
CREATE TABLE students (student_id INT PRIMARY KEY, student_name VARCHAR(100) NOT NULL);
-- 3NF: a fact about the teacher lives in teachers, not in courses
CREATE TABLE teachers (teacher_id INT PRIMARY KEY, teacher_phone VARCHAR(20));
CREATE TABLE courses (course_id INT PRIMARY KEY,
teacher_id INT NOT NULL,
FOREIGN KEY (teacher_id) REFERENCES teachers (teacher_id));
-- The link table: a composite primary key stops duplicates
CREATE TABLE enrollments (student_id INT, course_id INT,
PRIMARY KEY (student_id, course_id));
Next time you design a table, look for anything you would have to update in more than one row. That is usually a sign it belongs in its own table.
Learn SQL step by step
Normalization is Chapter 19 of my book Simplify SQL for Absolute Beginners. It walks you through the whole path, from your first SELECT to transactions and window functions, with exercises and answers on the free ShopDB practice database.
As an Amazon Associate I earn from qualifying purchases.
Related articles
- SQL Constraints Explained Simply: NOT NULL, UNIQUE, CHECK and DEFAULT.
- SQL Data Types Explained Simply: choosing the right type for each column.
- SQL Indexes Explained Simply: what indexes are and when to add one.
- Types of Databases Explained: relational, document, key-value and more.
- Star Schema vs Snowflake Schema: where reporting tables deliberately break the normalization rules.
- SQL Antipatterns Review: The Best Book on Database Design Mistakes?: a book that shows the common table design mistakes normalization is meant to prevent.