Question

need a solution/explanation for this SQL problem. 7. Display a list of customer names with furniture series that purchased more than twice by this customer. Also, display the number of times of purcha...

need a solution/explanation for this SQL problem.

7. Display a list of customer names with furniture series that purchased more than twice by this customer. Also, display the number of times of purchase.

8. Display a list of furniture series that are priced above the average of all other series.

9. Display the customer ID of the the customers, the series and price of the most expensive furniture they purchased. Sort the result by customer ID in ascending order

CUSTOMER (Cust_ID, Cust_First_name, Cust_Last_Name, Cust_Email, Cust_Street, Cust_Coty, Cust_State, Cust_Zip, Cust_Gender, Cust_CC)

PURORDER (Order_ID, Cust_ID, Order_Date, ORder_Delivery)

SUPPLIER (Supp_ID, Supp_Name, Supp_Street, Supp_City, Supp_State, Supp_Zip, Supp_license)

FURNITURE (Furn_ID, Supp_ID, FUrn_series, FUrn_material,

FUrn_Type, Furn_Color, Furn_price)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

7.

select CUSTOMER.Cust_First_name, CUSTOMER.Cust_Last_Name, FURNITURE.FUrn_series, count(FURNITURE.FUrn_series)
from CUSTOMER, PURORDER, SUPPLIER, FURNITURE
where CUSTOMER.Cust_ID=PURORDER.Cust_ID
AND PURORDER.Order_ID=SUPPLIER.Order_ID
AND SUPPLIER.Supp_ID=FURNITURE.Supp_ID
AND sum(FURNITURE.FUrn_series)>2;

8.

select FURNITURE.FUrn_series
from CUSTOMER, PURORDER, SUPPLIER, FURNITURE
where CUSTOMER.Cust_ID=PURORDER.Cust_ID
AND PURORDER.Order_ID=SUPPLIER.Order_ID
AND SUPPLIER.Supp_ID=FURNITURE.Supp_ID
AND FURNITURE.Furn_price > avg(FURNITURE.Furn_price);

9.

select CUSTOMER.Cust_ID, FURNITURE.FUrn_series, max(FURNITURE.Furn_price)
from CUSTOMER, PURORDER, SUPPLIER, FURNITURE
where CUSTOMER.Cust_ID=PURORDER.Cust_ID
AND PURORDER.Order_ID=SUPPLIER.Order_ID
AND SUPPLIER.Supp_ID=FURNITURE.Supp_ID
ORDER BY CUSTOMER.Cust_ID;

Add a comment
Know the answer?
Add Answer to:
need a solution/explanation for this SQL problem. 7. Display a list of customer names with furniture series that purchased more than twice by this customer. Also, display the number of times of purcha...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT