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

Please write the two queries for part a) and b). Here\'s the table structure. Pa

ID: 3878765 • Letter: P

Question

Please write the two queries for part a) and b). Here's the table structure.

Part a) Write a query that provides the following result from the Sales.OrderDetails table using the appropriate functions and calculations.

Part b) Write a query that produces the following results. The query uses the Sales.OrderDetails table. The results are sorted by the line item total values from largest to smallest. The results should only contain line items where the net value is greater than $3,000.00. Further more, the line items must have a quantity of at least 100 items.

InsideTSQL2008 " Database Diagrams Tables System Tables FileTables External Tables HR·Employees Production·Categories Production·Products Production,Suppliers Sales·Customers Sales·OrderDetails El Sales·Orders Sales,Shippers

Explanation / Answer

since table structure is not defined so assuming the table columns

1) select sum(orders) as "Number Of Orders" , sum(value) as "Net Value Of All Orders" from Sales.OrderDetails


2) select orderId, Quantity , net_value as "Line Item Total" from Sales.OrderDetails where net_Value > 3000 and quantity >=100 order by net_Value desc