0% found this document useful (0 votes)
2 views3 pages

Database Normalization Examples

The document provides examples of normalizing a library database and a student enrollment database through various normal forms (1NF, 2NF, and 3NF). It illustrates how to structure data to eliminate redundancy and ensure that all attributes depend solely on primary keys. The examples demonstrate the transformation from unnormalized tables to normalized forms, highlighting the importance of maintaining data integrity.

Uploaded by

raneerizal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Database Normalization Examples

The document provides examples of normalizing a library database and a student enrollment database through various normal forms (1NF, 2NF, and 3NF). It illustrates how to structure data to eliminate redundancy and ensure that all attributes depend solely on primary keys. The examples demonstrate the transformation from unnormalized tables to normalized forms, highlighting the importance of maintaining data integrity.

Uploaded by

raneerizal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Example 1: Library Database

Unnormalized Table

Book Published Author


Book Title Author Publisher Genre
ID Year Birthdate
Database
1 John Doe TechBooks Technology 2021 1980-05-01
Design
Jane
2 Data Analysis DataWorld Data Science 2020 1975-07-20
Smith
3 AI Revolution John Doe TechBooks AI 2019 1980-05-01

First Normal Form (1NF)

 Each cell must contain only a single value, and each record must be unique.

Book ID Book Title Author Publisher Genre Published Year


1 Database Design John Doe TechBooks Technology 2021
2 Data Analysis Jane Smith DataWorld Data Science 2020
3 AI Revolution John Doe TechBooks AI 2019
Author ID Author Birthdate

1 John Doe 1980-05-01

2 Jane Smith 1975-07-20

Second Normal Form (2NF)

 Must be in 1NF.
 All non-key attributes must depend on the whole primary key.

Book ID Book Title Publisher Genre Published Year


1 Database Design TechBooks Technology 2021
2 Data Analysis DataWorld Data Science 2020
3 AI Revolution TechBooks AI 2019
Author ID Author Birthdate

1 John Doe 1980-05-01

2 Jane Smith 1975-07-20


Book ID Author ID
1 1
2 2
3 1
Third Normal Form (3NF)

 Must be in 2NF.
 All attributes must be dependent only on the primary key.

Since there are no transitive dependencies in the 2NF example, the 3NF remains the same.

Example 2: Student Enrollment Database

Unnormalized Table

Student ID Student Name Course Instructor Semester Grade


1 Alice Smith Database Design Prof. Johnson Spring 2022 A
2 Bob Johnson Data Analysis Prof. Davis Fall 2021 B
3 Alice Smith Data Analysis Prof. Davis Fall 2021 A

First Normal Form (1NF)

Student Student Course Instructor


Course Instructor Semester Grade
ID Name ID ID
Database Prof. Spring
1 Alice Smith 101 1001 A
Design Johnson 2022
Bob Data
2 102 1002 Prof. Davis Fall 2021 B
Johnson Analysis
Data
3 Alice Smith 102 1002 Prof. Davis Fall 2021 A
Analysis

Second Normal Form (2NF)

Student ID Student Name

1 Alice Smith

2 Bob Johnson
Course ID Course Instructor ID Semester
101 Database Design 1001 Spring 2022
102 Data Analysis 1002 Fall 2021
Instructor ID Instructor
1001 Prof. Johnson
1002 Prof. Davis
Student ID Course ID Grade
1 101 A
2 102 B
3 102 A

Third Normal Form (3NF)


Initial 2NF Structure:

Book ID Book Title Publisher Genre Published Year


1 Database Design TechBooks Technology 2021
2 Data Analysis DataWorld Data Science 2020
3 AI Revolution TechBooks AI 2019
Author ID Author Birthdate

1 John Doe 1980-05-01

2 Jane Smith 1975-07-20


Book ID Author ID
1 1
2 2
3 1

Since our 2NF structure does not have any transitive dependencies, it is already in 3NF.

Student Enrollment Database in 3NF

Initial 2NF Structure:

Student ID Student Name

1 Alice Smith

2 Bob Johnson
Course ID Course Instructor ID Semester
101 Database Design 1001 Spring 2022
102 Data Analysis 1002 Fall 2021
Instructor ID Instructor
1001 Prof. Johnson
1002 Prof. Davis
Student ID Course ID Grade
1 101 A
2 102 B
3 102 A

Again, our 2NF structure does not have any transitive dependencies, so it is already in 3NF.

You might also like