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).