Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SELECT DISTINCT (CUSTOMER_LAST_NAME), NVL(ORDER_QTY,0) FROM CUSTOMERS C INNER JOIN ORDERS O ON C.CUSTOMER_ID = O.CUSTOMER_ID INNER JOIN ORDER_DETAILS D ON D.ORDER_ID = O.ORDER_ID WHERE CUSTOMER_LAST_NAME

SELECT DISTINCT (CUSTOMER_LAST_NAME), NVL(ORDER_QTY,0) FROM CUSTOMERS C INNER JOIN ORDERS O ON C.CUSTOMER_ID = O.CUSTOMER_ID INNER JOIN ORDER_DETAILS D ON D.ORDER_ID = O.ORDER_ID WHERE CUSTOMER_LAST_NAME = 'Blanca';

here i use Customers , Orders and Order_Deatails table .

9.A. Modify the query of part 8C( on top) to get the total order quantities per customer (sum over all the orders for each customer). Should you use both first and last name? What would happen if you use only the first name and two customers have the same first name?

B. Now generalize the query for all customers and check how the number of returned records changes based on whether you are using only the first, only the last or both first and last names.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions