Sample Header Ad - 728x90

Normalization of Grocery Shop Database: From 1NF to 3NF

-1 votes
2 answers
129 views
In a grocery shop, customers buy items, and the products have categories. The TotalQuantity represents the stock of products. 1NF:
OrderProduct (OrderID, OrderDate, OrderTime, CustomerID, CustomerName,
    CustomerAddress, CustomerNumber, CustomerEmail, ProductID, ProductName,
    UnitPrice, TotalQuantity, CategoryID, CategoryName, CategoryDescription)
What is correct and incorrect in my 2NF and 3NF? 2NF:
Order (OrderID, OrderDate, OrderTime, CustomerID)
Customer (CustomerID, Name, Address, PhoneNumber, Email)
Product (ProductID, ProductName, UnitPrice, CategoryID, TotalQuantity)
Category (CategoryID, CategoryName, Description)
OrderItem (OrderID, ProductID)
3NF:
Order (OrderID, OrderDate, OrderTime, CustomerID)
Customer (CustomerID, Name, Address, PhoneNumber, Email)
Product (ProductID, ProductName, UnitPrice, CategoryID, TotalQuantity)
Category (CategoryID, CategoryName, Description)
OrderItem (OrderID, ProductID)
ProductCategory (ProductID, CategoryID)
Asked by User190230UK (1 rep)
Dec 27, 2024, 07:26 AM
Last activity: Dec 29, 2024, 09:14 PM