Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Show your final 3NF tables and their FD diagrams as well as answering the questi

ID: 3814943 • Letter: S

Question

Show your final 3NF tables and their FD diagrams as well as answering the questions

Consider the following relations for an order-processing application data- base at ABC, Inc.

ORDER (O#, Odate, Cust#, Total_amount)

ORDER_ITEM(O#, I#, Qty_ordered, Total_price, Discount%)

Assume that each item has a different discount. The Total_price refers to one item, Odate is the date on which the order was placed, and the Total_amount is the amount of the order. If we apply a natural join on the relations ORDER_ITEM and ORDER in this database, what does the resulting relation schema RES look like? What will be its key? Show the FDs in this resulting relation. Is RES in 2NF? Is it in 3NF? Why or why not? (State assumptions, if you make any.) Show the tables in 3NF.

Explanation / Answer

iven tables and Assumptions are:
1)
ORDER (O#, Odate, Cust#, Total_amount)
Odate is the date on which the order was placed
Total_amount is the amount of the order

2)
ORDER_ITEM(O#, I#, Qty_ordered, Total_price, Discount%)
each item has a different discount.
The Total_price refers to one item


ORDER_ITEM Natural Join ORDER =>
Here the common column between both table is Order number(#), resulting table has the following columns.

(OI_O#, OI_I#, OI_Qty_ordered, OI_Total_price, OI_Discount%, O_Odate, O_Cust#, O_Total_amount)

The key for this resulting table would be
{OI_O#, OI_I#} The combination of OrderNumber and OrderItemNumber

Table's Normal Form:
1) 1NF (Yes)
In First Normal Form, any row must not have a column in which more than one value is saved, like separated with commas.
2) 2NF (NO)
As per the Second Normal Form there must not be any partial dependency of any column on primary key.
But here the O_ODate only depends on OI_O# Order Number
OI_Discount only depends on OI_I# Item Number

Therefor the resulting table is not in 2NF.


To make the table in 3NF We need to make the table in 2NF First, to do that we need to break the table.
Order Table
(OI_O#,O_Odate,O_Total_amount)
PK{OI_O#}
Item Table
(OI_I#,OI_Discount%,OI_Total_price)
PK{OI_I#}
Order_Item Table
(OI_O#, OI_I#, OI_Qty_ordered,O_Cust#)
PK{OI_O#}

The above three table is in 2NF
3) 3NF
Third Normal form applies that every non-prime attribute of table must be dependent on primary key, or we can say that, there should not be the case that a non-prime attribute is determined by another non-prime attribute.
Order Table
(OI_O#,O_Odate,O_Total_amount)
PK{OI_O#}
Item Table
(OI_I#,OI_Discount%,OI_Total_price)
PK{OI_I#}
Order_Item Table
(OI_O#, OI_I#, OI_Qty_ordered,O_Cust#)
PK{OI_O#}

Here all the non-prime attribute are dependedent on the Primary key and there is no any transitive dependency in the tables, so this tables are in 3NF.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote