Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago