What is database normalization?
Database normalization is the process of organizing the tables and columns of a relational database to reduce data redundancy and improve data integrity. In practice you split tables until each fact is stored in one place, so it can’t be stored twice with two different values. Courses on normalization in DBMS teach it as a ladder of normal forms: first (1NF), second (2NF), third (3NF) and Boyce-Codd (BCNF). Each is a rule a table meets or breaks, and each includes the one before it.
The rules are written in functional dependencies. A functional dependency X -> Y says that a value of X determines the value of Y: any two rows that agree on X also agree on Y. X is the determinant. A course code determines the course’s title, and a student id determines the student’s name. Normalizing a table means asking which determinant each column hangs on, and moving the column to a table where that determinant is the key.
A table that breaks a normal form stores one fact in many rows, and it shows in three anomalies:
- Update anomaly: a fact changed in one row and not in another, so the table holds two answers.
- Insert anomaly: a fact that can’t be stored until an unrelated fact exists.
- Delete anomaly: a fact lost when the last row that carried it is deleted.
The example is a school, a smaller cut of the student management system template: students, courses, teachers and the enrollments between them. It starts the way a spreadsheet would keep it, one row per student.
First normal form (1NF): one value per column
A table is in first normal form when every column holds a single, atomic value per row, there are no repeating groups, and a primary key tells the rows apart. The school’s first table breaks it, because Courses holds a list:
CREATE TABLE dbo.Student ( StudentId int NOT NULL CONSTRAINT PK_Student PRIMARY KEY, FullName nvarchar(100) NOT NULL, Courses nvarchar(200) NOT NULL );

INSERT INTO dbo.Student (StudentId, FullName, Courses) VALUES (1, N'Maya Chen', N'Algebra, Biology'), (2, N'Leo Park', N'Marine Biology, Algebar'); SELECT FullName FROM dbo.Student WHERE Courses LIKE N'%Biology%';
SQL Server stores both rows, and the query returns both students. Maya takes Biology; Leo takes Marine Biology, which matches '%Biology%' as well. “Algebar” went in too, since a string can’t have a foreign key. Counting a course’s students or renaming a course turns into string surgery. Splitting the list into Course1, Course2 and Course3 only moves the problem: three columns to search, and nowhere for a fourth course.
The fix gives each course of each student a row of its own. This script replaces dbo.Student, now without Courses, and adds dbo.Enrollment, which copies what the spreadsheet knew about a course into every row:
CREATE TABLE dbo.Student ( StudentId int NOT NULL CONSTRAINT PK_Student PRIMARY KEY, FullName nvarchar(100) NOT NULL ); CREATE TABLE dbo.Enrollment ( StudentId int NOT NULL, CourseCode char(3) NOT NULL, CourseTitle nvarchar(100) NOT NULL, TeacherId int NOT NULL, TeacherName nvarchar(100) NOT NULL, EnrolledOn date NOT NULL, CONSTRAINT PK_Enrollment PRIMARY KEY (StudentId, CourseCode), CONSTRAINT FK_Enrollment_Student_StudentId FOREIGN KEY (StudentId) REFERENCES dbo.Student (StudentId) );

Every column holds one value now, and the composite key (StudentId, CourseCode) stops a student from taking the same course twice, which puts the table in 1NF.
Second normal form (2NF): depend on the whole key
A table is in second normal form when it is in 1NF and no non-key column depends on only part of a candidate key. That is a partial dependency, and it needs a key of two or more columns: a table whose candidate keys are all single columns is in 2NF as soon as it is in 1NF.
dbo.Enrollment has three. CourseTitle, TeacherId and TeacherName depend on CourseCode alone; only EnrolledOn needs the whole pair. The anomalies follow:
INSERT INTO dbo.Student (StudentId, FullName) VALUES (1, N'Maya Chen'), (2, N'Leo Park'); INSERT INTO dbo.Enrollment (StudentId, CourseCode, CourseTitle, TeacherId, TeacherName, EnrolledOn) VALUES (1, 'ALG', N'Algebra', 5, N'Ana Ruiz', '2026-09-01'), (2, 'ALG', N'Algebra I', 5, N'Ana Ruiz', '2026-09-02'); INSERT INTO dbo.Enrollment (StudentId, CourseCode, CourseTitle, TeacherId, TeacherName, EnrolledOn) VALUES (NULL, 'CHE', N'Chemistry', 6, N'Sam Lee', '2026-09-01');
Msg 515, Level 16, State 2, Line 8
Cannot insert the value NULL into column 'StudentId', table 'School.dbo.Enrollment'; column does not allow nulls. INSERT fails.
The statement has been terminated.Both Algebra enrollments go in, one titled Algebra and one Algebra I, so course ALG now has two titles. Chemistry, which nobody takes yet, can’t be stored at all: StudentId is part of the primary key, and primary key columns can’t be NULL, so Msg 515 refuses the row. That is the insert anomaly. If Maya and Leo both drop Algebra, its title and teacher leave with their rows: the delete anomaly.
The fix moves every column that depends on CourseCode alone into dbo.Course, where the code is unique on its own (AK_Course_CourseCode) and CourseId is the primary key. This replaces dbo.Enrollment, which now holds the CourseId:
CREATE TABLE dbo.Course ( CourseId int NOT NULL CONSTRAINT PK_Course PRIMARY KEY, CourseCode char(3) NOT NULL CONSTRAINT AK_Course_CourseCode UNIQUE, Title nvarchar(100) NOT NULL, TeacherId int NOT NULL, TeacherName nvarchar(100) NOT NULL ); CREATE TABLE dbo.Enrollment ( StudentId int NOT NULL, CourseId int NOT NULL, EnrolledOn date NOT NULL, CONSTRAINT PK_Enrollment PRIMARY KEY (StudentId, CourseId), CONSTRAINT FK_Enrollment_Student_StudentId FOREIGN KEY (StudentId) REFERENCES dbo.Student (StudentId), CONSTRAINT FK_Enrollment_Course_CourseId FOREIGN KEY (CourseId) REFERENCES dbo.Course (CourseId) );

INSERT INTO dbo.Student (StudentId, FullName) VALUES (1, N'Maya Chen'), (2, N'Leo Park'); INSERT INTO dbo.Course (CourseId, CourseCode, Title, TeacherId, TeacherName) VALUES (1, 'ALG', N'Algebra', 5, N'Ana Ruiz'), (2, 'BIO', N'Biology', 5, N'Ana Ruiz-Diaz'), (3, 'CHE', N'Chemistry', 6, N'Sam Lee'); INSERT INTO dbo.Enrollment (StudentId, CourseId, EnrolledOn) VALUES (1, 1, '2026-09-01'), (2, 1, '2026-09-02'); INSERT INTO dbo.Enrollment (StudentId, CourseId, EnrolledOn) VALUES (2, 9, '2026-09-02');
Msg 547, Level 16, State 1, Line 10
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Enrollment_Course_CourseId". The conflict occurred in database "School", table "dbo.Course", column 'CourseId'.
The statement has been terminated.Chemistry goes in as a course with no students. Each title is stored once, so ALG can’t have two. And an enrollment in course 9, which doesn’t exist, fails with Msg 547. While courses were a list of names, nothing could check that.
Third normal form (3NF): nothing but the key
A table is in third normal form when it is in second normal form and no non-key column depends on the primary key transitively. A transitive dependency is a non-key column that depends on the key only through another non-key column. With 2NF, that gives the old rule: every non-key column depends on the key, the whole key, and nothing but the key.
dbo.Course is in 2NF, since both its candidate keys are single columns, but TeacherName hangs on TeacherId, not on the course: CourseId -> TeacherId -> TeacherName. The run above shows the cost. Teacher 5 is Ana Ruiz on Algebra and Ana Ruiz-Diaz on Biology, and SQL Server accepted both. Renaming her means updating every course she teaches.
The fix gives teachers a table and leaves only the teacher’s key in dbo.Course. This replaces dbo.Course:
CREATE TABLE dbo.Teacher ( TeacherId int NOT NULL CONSTRAINT PK_Teacher PRIMARY KEY, FullName nvarchar(100) NOT NULL ); CREATE TABLE dbo.Course ( CourseId int NOT NULL CONSTRAINT PK_Course PRIMARY KEY, CourseCode char(3) NOT NULL CONSTRAINT AK_Course_CourseCode UNIQUE, Title nvarchar(100) NOT NULL, TeacherId int NOT NULL, CONSTRAINT FK_Course_Teacher_TeacherId FOREIGN KEY (TeacherId) REFERENCES dbo.Teacher (TeacherId) );

A teacher has one name now, a teacher with no course yet can be stored, and a course can’t name a teacher who doesn’t exist.
Boyce-Codd normal form (BCNF): every determinant is a key
A table is in BCNF when, for every functional dependency X -> Y that holds, with Y not part of X, X is a super key: a candidate key or a set of columns that contains one. In short: every determinant is a candidate key. 3NF lets one case through, a dependency whose right side is part of a candidate key, and that case needs two candidate keys that overlap.
The school adds tutoring. A student has at most one tutor per course, and each tutor coaches a single course. A first design keys tutoring by student and course:
CREATE TABLE dbo.Tutoring ( StudentId int NOT NULL, CourseId int NOT NULL, TeacherId int NOT NULL, CONSTRAINT PK_Tutoring PRIMARY KEY (StudentId, CourseId), CONSTRAINT FK_Tutoring_Student_StudentId FOREIGN KEY (StudentId) REFERENCES dbo.Student (StudentId), CONSTRAINT FK_Tutoring_Course_CourseId FOREIGN KEY (CourseId) REFERENCES dbo.Course (CourseId), CONSTRAINT FK_Tutoring_Teacher_TeacherId FOREIGN KEY (TeacherId) REFERENCES dbo.Teacher (TeacherId) );

The dependencies are (StudentId, CourseId) -> TeacherId and TeacherId -> CourseId, which makes (StudentId, TeacherId) a second candidate key, overlapping the first in StudentId. Every column is part of some candidate key, so there is no non-key column to break 3NF. BCNF fails, because TeacherId determines CourseId without being a key:
INSERT INTO dbo.Student (StudentId, FullName) VALUES (1, N'Maya Chen'), (2, N'Leo Park'); INSERT INTO dbo.Teacher (TeacherId, FullName) VALUES (5, N'Ana Ruiz'), (7, N'Omar Haddad'); INSERT INTO dbo.Course (CourseId, CourseCode, Title, TeacherId) VALUES (1, 'ALG', N'Algebra', 5), (2, 'BIO', N'Biology', 5); INSERT INTO dbo.Tutoring (StudentId, CourseId, TeacherId) VALUES (1, 1, 7), (2, 2, 7);
Every row goes in. Omar Haddad, teacher 7, now coaches Algebra for Maya and Biology for Leo, against the rule. The fact “teacher 7 coaches Algebra” is copied into each of his rows, and no constraint compares the copies. If Maya leaves, nothing records which course Omar coaches.
The BCNF fix puts that dependency in a table where its determinant is the key, dbo.Tutor, and stores tutoring as a student and a tutor. This replaces dbo.Tutoring:
CREATE TABLE dbo.Tutor ( TeacherId int NOT NULL CONSTRAINT PK_Tutor PRIMARY KEY, CourseId int NOT NULL, CONSTRAINT FK_Tutor_Teacher_TeacherId FOREIGN KEY (TeacherId) REFERENCES dbo.Teacher (TeacherId), CONSTRAINT FK_Tutor_Course_CourseId FOREIGN KEY (CourseId) REFERENCES dbo.Course (CourseId) ); CREATE TABLE dbo.Tutoring ( StudentId int NOT NULL, TeacherId int NOT NULL, CONSTRAINT PK_Tutoring PRIMARY KEY (StudentId, TeacherId), CONSTRAINT FK_Tutoring_Student_StudentId FOREIGN KEY (StudentId) REFERENCES dbo.Student (StudentId), CONSTRAINT FK_Tutoring_Tutor_TeacherId FOREIGN KEY (TeacherId) REFERENCES dbo.Tutor (TeacherId) );

INSERT INTO dbo.Tutor (TeacherId, CourseId) VALUES (7, 1); INSERT INTO dbo.Tutoring (StudentId, TeacherId) VALUES (1, 7), (2, 7); INSERT INTO dbo.Tutor (TeacherId, CourseId) VALUES (7, 2);
Msg 2627, Level 14, State 1, Line 5
Violation of PRIMARY KEY constraint 'PK_Tutor'. Cannot insert duplicate key in object 'dbo.Tutor'. The duplicate key value is (7).
The statement has been terminated.Omar coaches Algebra, both students book him, and giving him Biology as well fails with Msg 2627 on PK_Tutor.
The split loses one rule. “One tutor per student per course” was the old primary key, and now it spans two tables: on this design, Maya can book a second Algebra tutor and SQL Server takes it. If that rule matters more, keep CourseId in the key of dbo.Tutoring and point a composite foreign key (TeacherId, CourseId) at a unique pair on dbo.Tutor: not BCNF, but both rules hold.
How far should you normalize?
Normalize to 3NF by default, and test for BCNF wherever a table has more than one candidate key, the only place the two differ. Fourth normal form deals with multivalued dependencies: one table recording two independent lists about the same key, say a teacher’s courses and the same teacher’s languages. Fifth deals with join dependencies, where a table splits without loss into three smaller ones but not into two. Both come up less often, and the fix has the same shape: split the table.
Denormalization goes the other way: it stores a value twice on purpose so reads skip a join. It starts from a normalized design, so you know which copy is the source and which ones have to follow it.
How ERDsmith helps
Two titles for ALG, a second name for Ana Ruiz, a tutor on two courses: each came from a column in the wrong table, and each fix was a new table and a relationship. That is design work, cheapest before there are rows to move. In ERDsmith a split is drawn, and the columns and lines follow from the keys:
dbo.Tutorgets rounded corners from its one identifying relationship:TeacherIdis its whole primary key, so the line fromdbo.Teacheris solid .CourseIdsits outside the key, so the line fromdbo.Coursestays dashed .- Deleting a table deletes the relationships that point to it, and a migrated column goes with its last relationship, so undoing a split leaves no stray columns behind.