Computer Science
Grade 10
20 min
Data Normalization
Data Normalization
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Define data normalization and explain its importance in preventing data anomalies.
Identify data redundancy and its negative impacts on a database.
Describe the rules for First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF).
Convert an unnormalized table into First Normal Form (1NF).
Decompose a table to meet the requirements of Second Normal Form (2NF).
Decompose a table to meet the requirements of Third Normal Form (3NF).
Create a simple, normalized database schema from a single, unnormalized table.
Ever tried to update a friend's phone number in a messy contact list, only to find you missed an old entry? 😫 Data normalization is how we clean up that kind of digital mess!
In this tutorial, you'll learn how to organ...
2
Key Concepts & Vocabulary
TermDefinitionExample
Data RedundancyThe unnecessary repetition of the same piece of data in multiple places within a database. This wastes space and can lead to errors.In a table of student activities, listing the student's name and grade next to every single activity they join instead of just once in a separate student table.
Data AnomalyAn error or inconsistency in the data that occurs during data insertion, deletion, or modification due to redundancy.If a teacher changes their office number, you might have to update it in 20 different rows for each class they teach. If you miss one, you have an update anomaly.
Primary KeyA column (or set of columns) in a table that uniquely identifies each row. It cannot have NULL values and must be unique.A `StudentID` number is a perfect primar...
3
Core Syntax & Patterns
First Normal Form (1NF)
1. Each cell must contain a single, atomic (indivisible) value.
2. Each row must be unique, identified by a primary key.
This is the first step. It solves the problem of having multiple values in one cell, like a list of phone numbers. To achieve 1NF, you break down these multi-valued cells into separate rows.
Second Normal Form (2NF)
1. The table must be in 1NF.
2. All non-key columns must depend on the *entire* primary key (no partial dependencies).
This rule applies only when you have a composite primary key. If a column only depends on one part of the composite key, you should move that column and the part of the key it depends on into a new table.
Third Normal Form (3NF)
1. The table must be in 2NF.
2. No non-key column should depend on...
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
You are given an unnormalized table: `(InvoiceNum, ProductID, CustomerID, CustomerName, CustomerAddress, ProductName, ProductPrice, Quantity)`. What is the most complete and accurate description of the normalization issues in this table?
A.It only has a partial dependency where `ProductName` depends on `ProductID`.
B.It only has a transitive dependency where `CustomerName` depends on `CustomerID`.
C.It has both partial dependencies (e.g., `ProductName` on `ProductID`) and transitive dependencies (e.g., `CustomerName` on `CustomerID`).
D.The table is already in 3NF and has no issues.
Challenging
Using the initial `Projects` table from the tutorial, a teacher, Mr. Smith, supervises 5 projects, and each project has 4 students. If Mr. Smith moves to a new office, how many rows in this single, unnormalized table would need to be updated?
A.1
B.5
C.9
D.20
Challenging
A database designer suggests keeping `CustomerCity` in the main `Orders` table (violating 3NF) because it avoids an extra 'join' operation and might be faster for some reports. What is the strongest counter-argument based on the principles taught in the tutorial?
A.Joins are always fast, so performance is not a concern.
B.The risk of data inconsistency from update anomalies outweighs the potential small performance gain.
C.3NF is an absolute rule that can never be broken for any reason.
D.It is better to store the city name multiple times for backup purposes.
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free