Question: open 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
open 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.PurchaseOrderDetail
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.PurchaseOrderDetail
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.PurchaseOrderDetail 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.PurchaseOrderDetail
5. We need to know the product id and the modified date of the products with special offer Half-Price Pedal Sale.
Table: Sales.SpecialOfferProduct Sales.SpecialOffer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
