DB Assigment 2
DB Assigment 2
Database Systems
Topic: Normalization
The original invoice data contains both bill-level and item-level details in a single flat table. This
structure causes repetition and potential anomalies. The report walks through transforming this
data from its initial Unnormalized Form (UNF) to First Normal Form (1NF), Second Normal
Form (2NF), and finally Third Normal Form (3NF).
Contact: 0300-0344999
Date: 2025-02-27
Time: 6:15 PM
Store
Bill No Date Time Item Name Qty Rate Discount Amount
Name
Zam Zam
Nescafe Chilled
464188 2025-02-27 6:15 Super 1 170 0 170
Mocha 220ml
Store
Zam Zam
Chat Masala
464188 2025-02-27 6:15 Super 3 120 60 300
(Shan)
Store
Zam Zam
Vermicelli
464188 2025-02-27 6:15 Super 3 85 0 255
National
Store
Zam Zam
Sandwich Spread
464188 2025-02-27 6:15 Super 3 250 0 750
(Youngs)
Store
Zam Zam Maktab Food
464188 2025-02-27 6:15 Super Green Chili 1 520 0 520
Store Pickle
Zam Zam
Heat Pad
464188 2025-02-27 6:15 Super 1 370 0 370
Medium
Store
Zam Zam
Daal Nimko
464188 2025-02-27 6:15 Super 1 50 50
100g
Store
• Data redundancy: Store and bill details are repeated for each item.
• Update anomaly: If store details change, they must be updated in multiple rows.
• Deletion anomaly: Deleting all items of a bill deletes the entire bill information.
3.2 First Normal Form (1NF)
1NF requires each column to contain atomic (indivisible) values and eliminates repeating groups.
Since the data is already atomic (each field holds one value), UNF is already in 1NF.
• ItemName → Rate
Here, the primary key for the entire table is composite: (BillNo, ItemName).
Decomposition:
Tables:
Bill Table
BillItems Table
To achieve 3NF:
• Similarly, each item will have an ItemID as a unique identifier instead of Item Name.
Final relations:
Tables:
Store Table
Bill Table
Item Table
BillItems Table
5. Conclusion
This report thoroughly details the normalization of the Zam Zam Super Store invoice data. By
decomposing the original flat data into well-structured relational tables, we reduce redundancy
and enhance data integrity. The use of StoreID, BillNo, and ItemID as keys establishes clear
relationships. The discount is appropriately maintained at the transactional level in BillItems to
reflect real-world billing scenarios.
This normalized database structure is ready for implementation in any relational database
system, supporting efficient querying, updates, and management.