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

Write queries 5. List names of customers (without duplicates) who has any order(

ID: 3573872 • Letter: W

Question

Write queries

5. List names of customers (without duplicates) who has any order(s) and who has no any order(s)
using a JOIN statement.
6. Using view (dynamic) statement, list names of all customers who has yet to buy anything.
Column to show: customer name.

hwquery New customer Columns New CITY CUST ID a CUST NAME STATE I STREET LI ZIPCODE Indexes T- orderline Columns New order id product id quantity Indexes ordertable -Il Columns New cust id order date order id Indexes product Column New product id product name product price Indexes

Explanation / Answer

#5

select distinct A.cust_name as cutomer_with_orders,

(select distinct cust_name from customer B where A.cust_id != B.cust_id) as customers_without_orders

from ordertable A;

#6

create view custnamesyettobuy as

select cust_name from customer

where cust_id not in (select distinct cust_id from ordertable);

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