0% found this document useful (0 votes)
10 views2 pages

Table Example

The document discusses the first, second, and third normal forms (1NF, 2NF, 3NF) for database tables. 1NF requires each column to contain a single value. 2NF requires columns to be fully dependent on the primary key. 3NF eliminates transitive dependencies where a column's value depends on another non-primary key column. Examples are given for tables that violate each normal form and how to transform the tables to satisfy the normal form.

Uploaded by

sausubhadip007
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)
10 views2 pages

Table Example

The document discusses the first, second, and third normal forms (1NF, 2NF, 3NF) for database tables. 1NF requires each column to contain a single value. 2NF requires columns to be fully dependent on the primary key. 3NF eliminates transitive dependencies where a column's value depends on another non-primary key column. Examples are given for tables that violate each normal form and how to transform the tables to satisfy the normal form.

Uploaded by

sausubhadip007
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/ 2

Example: Consider a table with student information:

StudentID Courses
1 Math, Physics, Chem
2 English, History

This table is not in 1NF because the "Courses" column contains a list of values.

To convert it to 1NF:

StudentID Course
1 Math
1 Physics
1 Chem
2 English
2 History

2. Second Normal Form (2NF):

Definition:

 A table is in 2NF if it is in 1NF and all non-key attributes are fully functionally
dependent on the primary key.

Requirements:

 It must be in 1NF.
 All non-key attributes must be fully functionally dependent on the primary key.

Example: Consider a table with information about courses and instructors:

CourseID Instructor InstructorEmail


1 Dr. Smith smith@email.com
2 Dr. Brown brown@email.com
3 Dr. Smith smith@email.com

This table is not in 2NF because the "InstructorEmail" attribute is dependent on the
instructor, which is part of the composite primary key.

To convert it to 2NF:

CourseID Instructor
1 Dr. Smith
2 Dr. Brown
3 Dr. Smith
Instructor InstructorEmail
Dr. Smith smith@email.com
Dr. Brown brown@email.com

3. Third Normal Form (3NF):

Definition:

 A table is in 3NF if it is in 2NF, and there are no transitive dependencies: no non-


prime attribute is transitively dependent on any super key.

Requirements:

 It must be in 2NF.
 Eliminate transitive dependencies.

Example: Consider a table with information about students, courses, and instructors:

StudentID StudentName Instructor InstructorEmail


1 Alice Dr. Smith smith@email.com
2 Bob Dr. Brown brown@email.com

This table is not in 3NF because "InstructorEmail" is transitively dependent on the primary
key (StudentID).

To convert it to 3NF:

InstructorID
StudentID Instructor
StudentName InstructorEmail
InstructorID
11 Dr. Smith
Alice smith@email.com
1
22 Dr. Brown
Bob brown@email.com
2

In this transformed structure, "InstructorEmail" is no longer transitively dependent on the


primary key, and the table is in 3NF.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy