DATABASE SYSTEMS Information that will be used: AllTaste Restaurant database design: Some entity information and documents are known as follows: Food Menu: food menu code, food menu name, food category, regional specialty, price, menu image (one menu can have many pictures), number of portions available per day. Customer: customer code, customer's full name, place of birth, date of birth, gender, address, email, phone number, WA number. Employee: employee code, employee name, phone number, position. Restaurant Branch: Branch code, branch name, address, city, phone number, WA number, email. An example of a purchase receipt form as follows (picture): Normalization: Unnormalized schema Receipt (Receiptcode, Date, Customercode-Name, CustPhone,CustAddress Payment mode, EmployeeNum, EmployeeName,ItemCode,ItemName, Quantity, UnitPrice, Discount, TotalPrice, TotalPay) 1NF ( identifying the key attributes and avoiding redundancy) Receipt (Receiptcode, Date, Customercode,Name,Phone, Address ,Payment mode, EmployeeNum, EmployeeName,ItemCode,ItemName, (Quantity,UnitPrice, Discount),TotalPrice, TotalPay) 2NF ( removing the partial dependencies) ReceiptCode, ItemCode together determines the quantity, price, discount and the total Price. Hence the schema is restructured as Receipt (Receiptcode, Date, Customercode,Name, CustPhone, CustAddress, Payment mode, EmployeeNum, EmployeeName, TotalPay) Receipt_Item( ReceiptCode, ItemCode, quantity, TotalPrice, Discount) Item ( ItemCode, ItemName, UnitPrice) 3NF ( Removing the transitive dependencies) Receipt (Receiptcode, Date, CustomerCode, Payment mode, EmpNum, TotalPay) Customer(CustomerCode,CustName, CustPhone, custAddress) Employee( EmpNum, EmpName) Receipt_Item( ReceiptCode, ItemCode, quantity, TotalPrice, Discount) Item ( ItemCode, ItemName, UnitPrice). TO-DO: Please draw the ERD from the table of results for the 3NF stages. ERD is completed with all attributes of each entity, PK, FK, multiplicity (participation and cardinality).
Information that will be used:
AllTaste Restaurant database design:
Some entity information and documents are known as follows:
- Food Menu: food menu code, food menu name, food category, regional specialty, price, menu image (one menu can have many pictures), number of portions available per day.
- Customer: customer code, customer's full name, place of birth, date of birth, gender, address, email, phone number, WA number.
- Employee: employee code, employee name, phone number, position.
- Restaurant Branch: Branch code, branch name, address, city, phone number, WA number, email.
An example of a purchase receipt form as follows (picture):
Normalization:
Unnormalized schema
Receipt (Receiptcode, Date, Customercode-Name, CustPhone,CustAddress Payment mode, EmployeeNum, EmployeeName,ItemCode,ItemName, Quantity, UnitPrice, Discount, TotalPrice, TotalPay)
1NF ( identifying the key attributes and avoiding redundancy)
Receipt (Receiptcode, Date, Customercode,Name,Phone, Address ,Payment mode, EmployeeNum, EmployeeName,ItemCode,ItemName, (Quantity,UnitPrice, Discount),TotalPrice, TotalPay)
2NF ( removing the partial dependencies)
ReceiptCode, ItemCode together determines the quantity, price, discount and the total Price. Hence the schema is restructured as
Receipt (Receiptcode, Date, Customercode,Name, CustPhone, CustAddress, Payment mode, EmployeeNum, EmployeeName, TotalPay)
Receipt_Item( ReceiptCode, ItemCode, quantity, TotalPrice, Discount)
Item ( ItemCode, ItemName, UnitPrice)
3NF ( Removing the transitive dependencies)
Receipt (Receiptcode, Date, CustomerCode, Payment mode, EmpNum, TotalPay)
Customer(CustomerCode,CustName, CustPhone, custAddress)
Employee( EmpNum, EmpName)
Receipt_Item( ReceiptCode, ItemCode, quantity, TotalPrice, Discount)
Item ( ItemCode, ItemName, UnitPrice).
TO-DO:
Please draw the ERD from the table of results for the 3NF stages. ERD is completed with all attributes of each entity, PK, FK, multiplicity (participation and cardinality).
Step by step
Solved in 2 steps with 1 images