Organizing a Sales Database into Second Normal Form (2NF)
📖 Scenario: You are managing a small store's sales data. Currently, all sales information is stored in one table, but it has repeated data and some inefficiencies.Your task is to organize this data into Second Normal Form (2NF) to reduce redundancy and improve data integrity.
🎯 Goal: Create tables that follow Second Normal Form (2NF) by removing partial dependencies from the sales data.
📋 What You'll Learn
Create an initial table called
Sales with columns OrderID, ProductID, ProductName, Quantity, and Price.Add a primary key constraint on the combination of
OrderID and ProductID.Create a new table called
Products with columns ProductID and ProductName to remove partial dependency.Modify the
Sales table to remove ProductName column after creating Products table.💡 Why This Matters
🌍 Real World
Organizing sales data in a store database to avoid repeating product names in every order line.
💼 Career
Database designers and developers use normalization to create efficient, maintainable databases that reduce errors and improve performance.
Progress0 / 4 steps