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

Using the Classic Model dataset, write the SQL that answers the following questi

ID: 3820324 • Letter: U

Question

Using the Classic Model dataset, write the SQL that answers the following question. List the product name, product code, product line, and product line description for all products that are part of the Motorcycles product line. Using the Classic Model dataset, write the SQL that answers the following question. Report average payments for each customer. Order the list ascending by customer name. Output should include the average payment amount and customer name Using the classic Model dataset, write the SQL that answers the following question. List the value of shipped orders for each customer. The output should include the customer name, and total value of the order. Order the results by customer name. Using the Classic Model dataset, write the SQL that answers the following question. List the customer name, order number, and value of the order for customers that had orders with a value of less than $10,000. Order the results by value descending. Using the Classic Model dataset, write the SQL that answers the following question. List the product name, the customer name, the sales rep first name and last name, and the order number for all products shipped on a Tuesday. Order the results descending by the last name of the sales rep, followed by the first name, and then finally the customer name.

Explanation / Answer

since the table names are not given so assuming the columnname and table names

3) select c.customer_name, sum(orderValue) as TotalOrderValue from customers c inner join orders o on c.custId = o.custId where o.shipped ='Y' group by c.customer_name order by c.customer_name desc

since the order table will contain a column that will help to know whether the product is delivered or not so assuming that column name is Shipped and it's value will be Y once the order is shipped.

4) select c.customer_name, o.orderId , o.orderValue from customers c inner join orders o on c.custId = o.custId where o.orderValue <10000 order by o.ordervalue desc;

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