Answer to Question #138461 in Databases | SQL | Oracle | MS Access for Dave

Question #138461
*Northwind Trader (SQL)* Using the OrderDetails table, list the ProductID, the total number of orders that product was included in, and the max discount amount on any order of that product. Provide appropriate column names for the number of orders and max discount amount. Only include products where the max discount amount for that product was greater than $1,000.
1
Expert's answer
2020-10-15T09:50:57-0400
SELECT MAX(ValueOfOrders) ValueOfOrders
FROM
(
select 
    sum(unitprice * quantity * 1+Discount) as ValueOfOrders
from 
    OrderDetails od 
join 
    orders o on od.OrderID = o.OrderID 
group by 
    CustomerID
) T

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS