Understanding Normalization
First Normal Form (1NF):
Eliminate Repeating Groups: Ensure each table has a primary key and that all attributes are atomic (indivisible).
ExampleIn a library database, separate borrower information from book details.
Second Normal Form (2NF):
Remove Partial Dependencies: Ensure that all non-key attributes are fully dependent on the primary key.
ExampleIn a transaction table, separate item details from customer information.
Third Normal Form (3NF):
Eliminate Transitive Dependencies: Ensure that non-key attributes depend only on the primary key.
ExampleIn an e-commerce database, separate artist information from item details.
Real-World Scenario: E-Commerce Database
- Unnormalized Data:
- Table: Transactions
- Attributes: Customer ID, Customer Email, Item ID, Item Description, Artist Name, Artist Email
- First Normal Form (1NF):
- Separate Tables:
- Customer: Customer ID, Customer Email
- Item: Item ID, Item Description, Artist Name, Artist Email
- Separate Tables: