Question: Adventurework2014 database as your default database. Do not forget to use the SQL standards. 1. We need to know the number of products we have
Adventurework2014 database as your default database. Do not forget to use the SQL standards.
1. We need to know the number of products we have in the PurchaseOrderDetail table. (count the number of un-repeated productid)
TABLE: Purchasing.Purchase OrderDetail
2. Write a query to show the productID of the most profitable product(ignore production costs) after price and order quantity are considered (maximum amount of money gained for each product id) Use SUM and group by to get the best result. HINT: Should be 3358797.75
TABLE: Purchasing.Purchase OrderDetail
3. Write a query to show the names of the top 5 most profitable products, as in question 2. Remember to take both price and quantity sold into account. You must join two tables.
TABLE: Purchasing.Purchase OrderDetail Production.Product
4. Write a query to show all product ID with the stock quantity less than average stock quantity. You have to use sub query
TABLE: Purchasing.Purchase OrderDetail
5. We need to know the product id and the modified date of the products with special offer Half-Price Pedal Sale.
TABLE: Sales.SpecialOfferP roduct Sales.SpecialOffer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
