Database Normalization Page 2

Written By
DF
David Faour
Published: Jul 20, 2010
Updated: Nov 10, 2020
1 minute read
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Second Normal Form requires that any non-key field be dependent upon the entire key. For example,
consider the StudentCourses table below, where StudentID and
CourseID form a compound primary key.

StudentIDCourseIDStudentNameCourseLocationGrade
123453100AprilMath BuildingA
123451300AprilScience BuildingB

The
Student Name field does not depend at all on CourseID, but only on
Student ID. CourseLocation has be dependency on StudentID, but only
on CourseID.

This data should be split into three tables as follows:

Students Table

StudentIDName
12345April

Courses Table

CourseIDCourseLocation
3100Math Building
1300Science
Building

Student Courses Table

StudentIDCourseIDGrade
123453100A
123451300B

In
this example, grade was the only field dependent on the combination
of StudentID and CourseID.

Let’s
suppose that in the first table design, the first row of data was
entered with a StudentName of Aprok, a simple typo. Now, suppose the
following SQL is run.

Advertisement

Delete from StudentCourses where StudentName=”April”

The
erroneous “Aprok” row will not be deleted. However, in the final
design, using the following SQL:

Delete From StudentCourses where StudentID=12345

will
delete every course that April was in by using the ID.

Original date of publication, 02/21/2001

ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.