Question

In: Computer Science

Below is an invoice sent out by MegaCorp. Order ID Order Customer Customer Customer Product Product...

Below is an invoice sent out by MegaCorp.

Order ID

Order

Customer

Customer

Customer

Product

Product

Product

Product

Ordered

Date

Num

Name

Address

ID

Description

Finish

Standard Price

Quantity

1006

10/24/2018

2

HugeCorp

Chicago, IL

7

Widgets

Platinum

800

2

8

Widgets

Chrome

790

4

5

Wadgets

Cherry

325

2

4

Scaffolding

Silver

650

1

1007

10/25/2018

6

LittleCorp

Edwardsville, IL

7

Widgets

Platinum

800

1

11

Ladder

Silver

275

3

1008

10/26/2018

2

Huge Corp

Chicago, IL

5

Wadgets

Cherry

325

2

4

Scaffolding

Silver

650

1

STEP 1:

Convert the above to 1NF

  1. Provide a relation of the above INVOICE, underlining the primary keys.

STEP 2:

Consider the following functional dependencies of the invoice data:

OrderID à OrderDate, CustomerNum, CustomerName, CustomerAddress

ProductID à ProductDescription, ProductFinish, ProductStandardPrice

STEP 3:

Convert your 1NF table to 2NF. (i.e., look only at non-key attributes that are dependent on a single PK)

A relation is in 2NF if it contains no partial functional dependencies.

  1. Provide me 2NF relations based on the dependencies above. BE CAREFUL:   I am NOT asking you to do 3NF yet!!

STEP 4:

Now, you’ve realized there are some additional functional dependencies:

CustomerNum à CustomerName, CustomerAddress

Convert your 2NF relations to 3NF based on the dependencies you just received.

Solutions

Expert Solution

Step 1: 1NF

INVOICE(OrderID, OrderDate, CustomerNum, CustomerName,CustomerAddress,ProductID, ProductDescription, ProductStandardPrice, OrderedQuantity)

Composite Primary Key(OrderID,ProductID)

Order ID

Order

Customer

Customer

Customer

Product

Product

Product

Product

Ordered

Date

Num

Name

Address

ID

Description

Finish

Standard Price

Quantity

1006

10/24/2018

2

HugeCorp

Chicago, IL

7

Widgets

Platinum

800

2

1006 10/24/2018 2 HugeCorp Chicago, IL

8

Widgets

Chrome

790

4

1006 10/24/2018 2 HugeCorp Chicago, IL

5

Wadgets

Cherry

325

2

1006 10/24/2018 2 HugeCorp Chicago, IL

4

Scaffolding

Silver

650

1

1007

10/25/2018

6

LittleCorp

Edwardsville, IL

7

Widgets

Platinum

800

1

1007 10/25/2018 6 LittleCorp Edwardsville, IL

11

Ladder

Silver

275

3

1008

10/26/2018

2

Huge Corp

Chicago, IL

5

Wadgets

Cherry

325

2

1008 10/26/2018 2 Huge Corp Chicago, IL

4

Scaffolding

Silver

650

1

STEP 2:

functional dependencies :

Partial Dependencies:

OrderID -> OrderDate, CustomerNum, CustomerName, CustomerAddress

ProductID ->ProductDescription, ProductFinish, ProductStandardPrice

Full Dependency:

OrderID,ProductID -> OrderedQuantity

Step 3:

Tables in 2NF

Order(OrderID OrderDate, CustomerNum, CustomerName, CustomerAddress)

Order ID

Order

Customer

Customer

Customer

Date

Num

Name

Address

1006

10/24/2018

2

HugeCorp

Chicago, IL

1007

10/25/2018

6

LittleCorp

Edwardsville, IL

1008

10/26/2018

2

Huge Corp

Chicago, IL

Product(ProductID ,ProductDescription, ProductFinish, ProductStandardPrice)

Product

Product

Product

Product

ID

Description

Finish

Standard Price

7

Widgets

Platinum

800

8

Widgets

Chrome

790

5

Wadgets

Cherry

325

4

Scaffolding

Silver

650

11

Ladder

Silver

275

OrderProduct(OrderID,ProductID , OrderedQuantity)

Order ID

Product

Ordered

ID

Quantity

1006

7

2

1006

8

4

1006

5

2

1006

4

1

1007

7

1

1007

11

3

1008

5

2

1008

4

1

STEP 4:

3NF

Transitive Dependencies:

CustomerNum -> CustomerName, CustomerAddress

Tables in 3NF

Order(OrderID OrderDate, CustomerNum, CustomerName, CustomerAddress)

Order ID

Order

Customer

Date

Num

1006

10/24/2018

2

1007

10/25/2018

6

1008

10/26/2018

2

Product(ProductID ,ProductDescription, ProductFinish, ProductStandardPrice)

Product

Product

Product

Product

ID

Description

Finish

Standard Price

7

Widgets

Platinum

800

8

Widgets

Chrome

790

5

Wadgets

Cherry

325

4

Scaffolding

Silver

650

11

Ladder

Silver

275

OrderProduct(OrderID,ProductID , OrderedQuantity)

Order ID

Product

Ordered

ID

Quantity

1006

7

2

1006

8

4

1006

5

2

1006

4

1

1007

7

1

1007

11

3

1008

5

2

1008

4

1

Customer(CustomerNum , CustomerName, CustomerAddress)

Customer

Customer

Customer

Num

Name

Address

2

HugeCorp

Chicago, IL

6

LittleCorp

Edwardsville, IL

underlined are primary keys and italicised are foreign keys. Some attributes are both.

Do ask if any doubt. Please upvote.


Related Solutions

Below is an invoice sent out by MegaCorp. Order ID Order Customer Customer Customer Product Product...
Below is an invoice sent out by MegaCorp. Order ID Order Customer Customer Customer Product Product Product Product Ordered Date Num Name Address ID Description Finish Standard Price Quantity 1006 10/24/2018 2 HugeCorp Chicago, IL 7 Widgets Platinum 800 2 8 Widgets Chrome 790 4 5 Wadgets Cherry 325 2 4 Scaffolding Silver 650 1 1007 10/25/2018 6 LittleCorp Edwardsville, IL 7 Widgets Platinum 800 1 11 Ladder Silver 275 3 1008 10/26/2018 2 Huge Corp Chicago, IL 5 Wadgets...
A mail order company gives 5% discount on all customer orders with advanced payment sent with...
A mail order company gives 5% discount on all customer orders with advanced payment sent with the order. If a regular customer places an order of $5,000 or more also receives 5% discount. Otherwise no discount given. (A) Write process specification for the mail order using Structured English    (B) To document the decision process for mail order using decision table, List the conditions with condition alternatives    List the Actions to be taken Construct the decision table for this...
How many customers purchased more than 1 product? (Hint: Customer ID stays the same per customer...
How many customers purchased more than 1 product? (Hint: Customer ID stays the same per customer when he/she buys several food boxes) Please Tell me the steps on how this would be solved using Excel. Note that this is not the full excel data but just a small sample. date_sign_up customer_id product_name marketing_channel City 4/17/2015 13:11 71041 Classic - 3 meals per week for 2 people Search Engine Marketing San Diego 4/14/2015 11:32 103289 Classic - 3 meals per week...
Mary matches the sales order marked "shipped” to her copy of the sales order. She then prepares a two-part invoice and mails the original to the customer.
Mary matches the sales order marked "shipped” to her copy of the sales order. She then prepares a two-part invoice and mails the original to the customer. She records the sales in the sales journal and the receivables in the subsidiary ledger. Mary files by date her copy of the invoice with her copy of the sales order and the shipping documents. During the summer season, Mary’s Sunshine often has difficulty in shipping customer orders in a timely manner. Supplier...
Which customer ID bought most food boxes? Explain how you determined relevant customer ID and note...
Which customer ID bought most food boxes? Explain how you determined relevant customer ID and note down which city this customer ID comes from Please Tell me the steps on how this would be solved using Excel. Note that this is not the full excel data but just a small sample. date_sign_up customer_id product_name marketing_channel City 4/17/2015 13:11 71041 Classic - 3 meals per week for 2 people Search Engine Marketing San Diego 4/14/2015 11:32 103289 Classic - 3 meals...
Ann Elkin, who works for Brill Co., has been sent out to conduct two customer evaluations,...
Ann Elkin, who works for Brill Co., has been sent out to conduct two customer evaluations, which have gone much more quickly than Ann anticipated. Her supervisor does not expect Ann back until after lunch. It is now 10:30 A.M., and Ann would like to run some personal errands and then go to lunch before returning to work at 1:00 P.M. Should Ann take the time? Would you? Why or why not? Is this any different than if Ann was...
Surveys were sent out to four different test groups asking them for product ratings. Determine if...
Surveys were sent out to four different test groups asking them for product ratings. Determine if there is evidence that the mean product ratings differ among the four test groups. Use a 0.01 level of significance. Test Group 1 Test Group 2 Test Group 3 Test Group 4 16 11 11 16 11 19 15 13 12 19 16 14 11 17 16 15 14 18 16 16 62 1.) What is the correct hypotheses statements? 2.)What is the F-statistic...
Customer Order Example ORDER NO: 61384                                    &
Customer Order Example ORDER NO: 61384                                                            ORDER DATE: 9/24/2014 CUSTOMER NO: 1273 CUSTOMER NAME: CONTEMPORARY DESIGNS CUSTOMER ADDRESS: 123 OAK ST. CITY STATE ZIP: AUSTIN, TX 28384 PRODUCT                                        QUANTITY    UNIT                          EXTENDED NO                DESCRIPTION         ORDERED    PRICE                        PRICE M128              BOOKCASE                4                   200.00                        800.00 B381               CABINET                      2                   150.00                        300.00            R210              TABLE                          1                   500.00                        500.00                                                                                     TOTAL                  1600.00 Normalize this user view. Make sure to show your work for each view – you should have 4 answers (e.g....
Creating a Perl Product Directory - A product "id" will be used to identify a product...
Creating a Perl Product Directory - A product "id" will be used to identify a product (the key) and the description will be stored as the value The program should print a menu asking you to "add" an entry, "remove" an entry, "lookup" an entry, "list" all entries, and "quit" to end The user will enter a number to select the menu item from above, 1, 2, 3, 4, or 5 respectively. Asks the user to enter a product ID,...
Product(p-id, p-name, weight) Retailer(r-id, r-name, city) Sells(r-id, p-id, price)
  Product(p-id, p-name, weight)Retailer(r-id, r-name, city)Sells(r-id, p-id, price) r-id is a foreign key referencing Retailerp-id is a foreign key referencing Product Give a Relational Algebra expression : (IT IS NOT SQL) (a) Find the names of the retailers who are selling the products that have a weight greater than 10 kg.(b) Find the names of the retailers who have never sold a product that has a weight greater than 10 kg.(c) Get the price of the products that have a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT