Thanks to visit codestin.com
Credit goes to www.scribd.com

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 [email protected]
2 Dr. Brown [email protected]
3 Dr. Smith [email protected]

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 [email protected]
Dr. Brown [email protected]

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 [email protected]
2 Bob Dr. Brown [email protected]

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 [email protected]
1
22 Dr. Brown
Bob [email protected]
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