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

1. (TCO 7) Consider the ERD below. What tables will be needed to create a report

ID: 3787903 • Letter: 1

Question

1. (TCO 7) Consider the ERD below. What tables will be needed to create a report showing the firstname and lastname of customers who have placed an order for any product with keyboard in the description?

A.     customer, product only
B.      customer, order, product only
C.      customer, orderline only
D.     customer, order, orderline, product

Customer PK customerID. ast name firstname order PK orderiD order date FK1 customer ID orderline PK,FK1 roductdD rderlD quantity Product PK productID description price

Explanation / Answer

Solution: D. customer, order, orderLine, product

Explanation:

Query to create a report showing the firstname and lastname of customers who have placed an order for any product with keyboard in the description:

To accomplish the above task keenly observe the ERD,

using productID we can get the description from Product table

Using the Combination of productID orderID we can get the corresponding order from OrderLine table

Using OrderID we can get the id of customer place from order table.

Finally we can find the first and last namses using the Customer table.

Query Looks like this:

select firstname ,lastname where customerID=(

select customerID from order where orderID =(

select orderID from OrderLine where productID in(

select productID from Productwhere description = 'keyboard')))