Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions