Docsity

Database Normalization: A Practical Guide with Exercises, Exercises of Database Management Systems (DBMS)

Toggle sidebar
bg1
DBS201 Exercise 5
Normalize User Views and Create a Final 3NF solution
Good News Grocers
User View 1 - Price Update List
Department Product
Code
Aisle
Number
Price Unit of
Measure
Produce 4081 1 0.35 lb
Produce 4027 1 0.90 ea
Produce 4108 1 1.99 lb
Butcher 331100 5 1.50 lb
Butcher 331105 5 2.40 lb
Butcher 332110 5 5.00 lb
Freezer 411100 6 1.00 ea
Freezer 521101 6 1.00 ea
Freezer 866503 6 5.00 ea
Freezer 866504 6 5.00 ea
This report is used by the department managers to update the prices that are
displayed in the grocery store for these products.
UNF
Department Product
Code
Aisle
Number
Price Unit of
Measure
Produce 4081 1 0.35 lb
Produce 4027 1 0.90 ea
Produce 4108 1 1.99 lb
Butcher 331100 5 1.50 lb
Butcher 331105 5 2.40 lb
Butcher 332110 5 5.00 lb
Freezer 411100 6 1.00 ea
Freezer 521101 6 1.00 ea
Freezer 866503 6 5.00 ea
Freezer 866504 6 5.00 ea
pf3
pf4
pf5
Discount

On special offer

Partial preview of the text

Download Database Normalization: A Practical Guide with Exercises and more Exercises Database Management Systems (DBMS) in PDF only on Docsity!

Normalize User Views and Create a Final 3NF solution

Good News Grocers User View 1 - Price Update List Department Product Code Aisle Number Price Unit of Measure Produce 4081 1 0.35 lb Produce 4027 1 0.90 ea Produce 4108 1 1.99 lb Butcher 331100 5 1.50 lb Butcher 331105 5 2.40 lb Butcher 332110 5 5.00 lb Freezer 411100 6 1.00 ea Freezer 521101 6 1.00 ea Freezer 866503 6 5.00 ea Freezer 866504 6 5.00 ea This report is used by the department managers to update the prices that are displayed in the grocery store for these products. UNF Department Product Code Aisle Number Price Unit of Measure Produce 4081 1 0.35 lb Produce 4027 1 0.90 ea Produce 4108 1 1.99 lb Butcher 331100 5 1.50 lb Butcher 331105 5 2.40 lb Butcher 332110 5 5.00 lb Freezer 411100 6 1.00 ea Freezer 521101 6 1.00 ea Freezer 866503 6 5.00 ea Freezer 866504 6 5.00 ea

Normalize User Views and Create a Final 3NF solution

1NF

Department Product Code Aisle Number Price Unit of Measure Produce 4081 1 0.35 lb Produce 4027 1 0.90 ea Produce 4108 1 1.99 lb Butcher 331100 5 1.50 lb Butcher 331105 5 2.40 lb Butcher 332110 5 5.00 lb Freezer 411100 6 1.00 ea Freezer 521101 6 1.00 ea Freezer 866503 6 5.00 ea Freezer 866504 6 5.00 ea 2NF Department Product Code Aisle Number Price Unit of Measure Produce 4081 1 0.35 lb Produce 4027 1 0.90 ea Produce 4108 1 1.99 lb Butcher 331100 5 1.50 lb Butcher 331105 5 2.40 lb Butcher 332110 5 5.00 lb Freezer 411100 6 1.00 ea Freezer 521101 6 1.00 ea Freezer 866503 6 5.00 ea Freezer 866504 6 5.00 ea 3NF Product Product Code Department Code Price Unit of Measure 4081 PR 0.35 lb 4027 PR 0.90 ea 4108 PR 1.99 lb 331100 BU 1.50 lb 331105 BU 2.40 lb

Normalize User Views and Create a Final 3NF solution

Good News Grocers User View 2: Product Cost Report Supplier Product Cost Markup Price Dept Code 21 โ€“ Very Veggie 4108 โ€“ tomatoes, plum 1.89 5% 1.99 PR 32 โ€“ Fab Fruits 4081 โ€“ bananas 0.20 75% 0.35 PR 32 โ€“ Fab Fruits 4027 โ€“ grapefruit 0.45 100% 0.90 PR 32 โ€“ Fab Fruits 4851 โ€“ celery 1.00 100% 2.00 PR 08 โ€“ Meats R Us 331100 โ€“ chicken wings 0.50 300% 1.50 BU 08 โ€“ Meats R Us 331105 โ€“ lean ground beef 0.60 400% 2.40 BU 08 โ€“ Meats R Us 332110 โ€“ boneless chicken breasts 2.50 100% 5.00 BU 10 โ€“ Jerryโ€™s Juice 411100 โ€“ orange juice 0.25 400% 1.00 FR 10 โ€“ Jerryโ€™s Juice 521101 โ€“ apple juice 0.25 400% 1.00 FR 45 โ€“ Icey Creams 866503 โ€“ vanilla ice cream 2.50 100% 5.00 FR 45 โ€“ Icey Creams 866504 โ€“ chocolate ice cream 2.50 100% 5.00 FR This report is used by the grocery store manager to determine the final selling price of his products. UNF Supplier Product Cost Markup Price Dept Code 21 โ€“ Very Veggie 4108 โ€“ tomatoes, plum 1.89 5% 1.99 PR 32 โ€“ Fab Fruits 4081 โ€“ bananas 0.20 75% 0.35 PR 32 โ€“ Fab Fruits 4027 โ€“ grapefruit 0.45 100% 0.90 PR 32 โ€“ Fab Fruits 4851 โ€“ celery 1.00 100% 2.00 PR 08 โ€“ Meats R Us 331100 โ€“ chicken wings 0.50 300% 1.50 BU 08 โ€“ Meats R Us 331105 โ€“ lean ground beef 0.60 400% 2.40 BU 08 โ€“ Meats R Us 332110 โ€“ boneless chicken breasts 2.50 100% 5.00 BU 10 โ€“ Jerryโ€™s Juice 411100 โ€“ orange juice 0.25 400% 1.00 FR 10 โ€“ Jerryโ€™s Juice 521101 โ€“ apple juice 0.25 400% 1.00 FR 45 โ€“ Icey Creams 866503 โ€“ vanilla ice cream 2.50 100% 5.00 FR 45 โ€“ Icey Creams 866504 โ€“ chocolate ice cream 2.50 100% 5.00 FR 1NF Supplier Product Cost Markup Price Dept Code 21 โ€“ Very Veggie 4108 โ€“ tomatoes 1.89 5% 1.99 PR 21 โ€“ Very Veggie 4108 -- plum 1.89 5% 1.99 PR 32 โ€“ Fab Fruits 4081 โ€“ bananas 0.20 75% 0.35 PR 32 โ€“ Fab Fruits 4027 โ€“ grapefruit 0.45 100% 0.90 PR 32 โ€“ Fab Fruits 4851 โ€“ celery 1.00 100% 2.00 PR 08 โ€“ Meats R Us 331100 โ€“ chicken wings 0.50 300% 1.50 BU 08 โ€“ Meats R Us 331105 โ€“ lean ground beef 0.60 400% 2.40 BU 08 โ€“ Meats R Us 332110 โ€“ boneless chicken breasts 2.50 100% 5.00 BU

Normalize User Views and Create a Final 3NF solution

10 โ€“ Jerryโ€™s Juice 411100 โ€“ orange juice 0.25 400% 1.00 FR 10 โ€“ Jerryโ€™s Juice 521101 โ€“ apple juice 0.25 400% 1.00 FR 45 โ€“ Icey Creams 866503 โ€“ vanilla ice cream 2.50 100% 5.00 FR 45 โ€“ Icey Creams 866504 โ€“ chocolate ice cream 2.50 100% 5.00 FR 2NF Prod Code Prod Desc Supplier ID Supplier Name Cost Markup Price Dept Code 4108 tomatoes 21 Very Veggie 1.89 5% 1.99 PR 4108 plum 21 Very Veggie 1.89 5% 1.99 PR 4081 bananas 32 Fab Fruits 0.20 75% 0.35 PR 4027 grapefruit 32 Fab Fruits 0.45 100% 0.90 PR 4851 celery 32 Fab Fruits 1.00 100% 2.00 PR 331100 chicken wings 08 Meats R Us 0.50 300% 1.50 BU 331105 lean ground beef 08 Meats R Us 0.60 400% 2.40 BU 332110 boneless chicken breasts 08 Meats R Us 2.50 100% 5.00 BU 411100 orange juice 10 Jerryโ€™s Juice 0.25 400% 1.00 FR 521101 apple juice 10 Jerryโ€™s Juice 0.25 400% 1.00 FR 866503 vanilla ice cream 45 Icey Creams 2.50 100% 5.00 FR 866504 chocolate ice cream 45 Icey Creams 2.50 100% 5.00 FR 3NF Product Prod Code Prod Desc Supplier ID Cost Markup Price Dept Code 4108 tomatoes 21 1.89 5% 1.99 PR 4108 plum 21 1.89 5% 1.99 PR 4081 bananas 32 0.20 75% 0.35 PR 4027 grapefruit 32 0.45 100% 0.90 PR 4851 celery 32 1.00 100% 2.00 PR 331100 chicken wings 08 0.50 300% 1.50 BU 331105 lean ground beef 08 0.60 400% 2.40 BU 332110 boneless chicken breasts 08 2.50 100% 5.00 BU 411100 orange juice 10 0.25 400% 1.00 FR 521101 apple juice 10 0.25 400% 1.00 FR

Normalize User Views and Create a Final 3NF solution

Merged 3NF solution: Department Dept Code Department Aisle Number PR Produce 1 BU Butcher 5 FR Freezer 6 Product Product Code Product Desc Unit Of Measure Dept Code Supplier ID Cost Markup 4108 tomatoes lb PR 21 1.89 5% 4108 plum ea PR 21 1.89 5% 4081 bananas lb PR 32 0.20 75% 4027 grapefruit lb PR 32 0.45 100% 4851 celery lb PR 32 1.00 100% 331100 chicken wings lb BU 08 0.50 300% 331105 lean ground beef ea BU 08 0.60 400% 332110 boneless chicken breasts ea BU 08 2.50 100% 411100 orange juice ea FR 10 0.25 400% 521101 apple juice ea FR 10 0.25 400% 866503 vanilla ice cream ea FR 45 2.50 100% 866504 chocolate ice cream ea FR 45 2.50 100% Supplier Supplier ID Supplier Name 08 Meat R US 10 Jerryโ€™s Juice 21 Very Veggie 32 Fab Fruits 45 Icey Creams