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

Given the schema and table above, Execute SQL statements to answer the following

ID: 3806319 • Letter: G

Question

Given the schema and table above, Execute SQL statements to answer the following questions:

a. Who are the customers who have placed 0 orders?

b. Who are the customers who have placed between 1 and 3 orders?

c. Who are the customers who have placed 4 or more orders?

E ...EEE CUSTOMERS CUSTOMER ID CUSTOMER FIRST NAME CUSTOMER LAST NAME CUSTOMER ADDRESS CUSTOMER CITY CUSTOMER STATE CUSTOMER ZIP CUSTOMER PHONE CUSTOMER FAX CUSTOMER STATUS ID EEE GENERAL LEDGER ACCOUNTS INVOICE LINE ITEMS INVOICES ITEMS E E ORDER DETAILS ORDER ID ITEM ID EEE ORDER QTY E ...EEE ORDERS ORDER-ID CUSTOMER ID ORDER DATE SHIPPED DATE

Explanation / Answer

a. Select distinct CUSTOMER_ID, CUSTOMER_FIRST_NAME, CUSTOMER_LAST_NAME from CUSTOMERS where CUSTOMER_ID NOT IN(select CUSTOMER_ID from ORDERS);

b. (Select distinct CUSTOMER_ID, CUSTOMER_FIRST_NAME, CUSTOMER_LAST_NAME from CUSTOMERS where COUNT(DISTINCT(ORDERS.CUSTOMER_ID))>1 AND COUNT(DISTINCT(ORDERS.CUSTOMER_ID))<3);

c. (Select distinct CUSTOMER_ID, CUSTOMER_FIRST_NAME, CUSTOMER_LAST_NAME from CUSTOMERS where COUNT(DISTINCT(ORDERS.CUSTOMER_ID))>=4);

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