Question & Answer: Write the SQL statements that will generate the following customer orders summary reports: a. A list of the customers and the total number o…..

2- Write the SQL statements that will generate the following customer orders summary reports: a] A list of the customers and the total number of orders (invoices) they placed. Customer Last Name Number of Invoices Dunne Orlando Smith Farriss OBrian 2 b. A list of the customers and the total number of products they purchased. Customer Last Name Number of Products Dunne Orlando Smith OBrian Farriss 6 A list of the customer, the total number of orders (invoices) they placed, the total number of products they purchased, and the total value of what they purchased. c. Last Name Number of Invoices Number of Products Total value 443.94 422.71 153.84 70.44 34.95 2 6

Write the SQL statements that will generate the following customer orders summary reports: a. A list of the customers and the total number of orders (invoices) they placed. b. A list of the customers and the total number of products they purchased. c. A list of the customer, the total number of orders (invoices) they placed, the total number of products they purchased, and the total value of what they purchased.

Expert Answer

 

SELECT count(numbr_of_prodcts) AS “total”,
customer.cust_firstName,customer.cust_lastName,
FROM salesman,customer
WHERE customer.numbr_of_prodcts=customer.numbr_of_prodcts;

select ProductID, sum(Quantity) as TotalQty from Orders group by ProductID

select ProductID,sum(number_of_invoices) as order, sum(total_value) as total, sum(numbr_of_prodcts) as TotalQty from Orders group by ProductID

Still stressed from student homework?
Get quality assistance from academic writers!