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

2NF and 3NF

Normalization in database design reduces redundancy and improves data integrity, with Second Normal Form (2NF) and Third Normal Form (3NF) being critical steps. 2NF eliminates partial dependencies by ensuring all non-prime attributes depend fully on the primary key, while 3NF removes transitive dependencies, ensuring non-prime attributes depend only on the primary key. By following these forms, databases achieve a more organized structure.

Uploaded by

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

2NF and 3NF

Normalization in database design reduces redundancy and improves data integrity, with Second Normal Form (2NF) and Third Normal Form (3NF) being critical steps. 2NF eliminates partial dependencies by ensuring all non-prime attributes depend fully on the primary key, while 3NF removes transitive dependencies, ensuring non-prime attributes depend only on the primary key. By following these forms, databases achieve a more organized structure.

Uploaded by

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

Normalization is a process in database design that organizes data to reduce redundancy and improve data integrity.

Second Normal Form (2NF) and Third Normal Form (3NF) are key steps in this process.

Second Normal Form (2NF)

A table is in 2NF if:

1. It is in First Normal Form (1NF) (all columns contain atomic data, and each column has unique values for
each row).

2. All non-prime attributes are fully functionally dependent on the entire primary key (no partial dependency
on just part of a composite key).

Example:

1NF Table (Unnormalized example):

OrderID ProductID ProductName SupplierName

1 101 Laptop Dell

1 102 Mouse Logitech

Problem: If the table has a composite primary key (OrderID + ProductID), the non-prime attribute SupplierName is
partially dependent only on ProductID, not the full key.

2NF Table: Split the table into two to remove partial dependency:

1. Orders Table: | OrderID | ProductID | |---------|-----------| | 1 | 101 | | 1 | 102 |

2. Products Table: | ProductID | ProductName | SupplierName | |-----------|--------------|--------------| | 101 |


Laptop | Dell | | 102 | Mouse | Logitech |

Now, all non-prime attributes (e.g., SupplierName) depend fully on their primary keys.

Third Normal Form (3NF)

A table is in 3NF if:

1. It is in 2NF.

2. No transitive dependency exists (non-prime attributes are not dependent on other non-prime attributes).

Example:

2NF Table:

ProductID ProductName SupplierID SupplierName

101 Laptop 1 Dell

102 Mouse 2 Logitech

Problem: SupplierName depends on SupplierID, which is not part of the primary key of this table (ProductID is the
primary key). This creates a transitive dependency.

3NF Table: Split the table further to remove the transitive dependency:

1. Products Table: | ProductID | ProductName | SupplierID | |-----------|--------------|------------| | 101 | Laptop |


1 | | 102 | Mouse | 2 |
2. Suppliers Table: | SupplierID | SupplierName | |------------|--------------| | 1 | Dell | | 2 | Logitech |

Now, there are no transitive dependencies.

Summary:

• 2NF ensures no partial dependencies (non-prime attributes depend fully on the primary key).

• 3NF removes transitive dependencies (non-prime attributes depend only on the primary key, not other non-
prime attributes).

You might also like