Question: Use Adventure works database and submit Azure workbook with queries and results Create a notebook with queries to answer the following questions: Write a query

Use Adventure works database and submit Azure workbook with queries and results

Create a notebook with queries to answer the following questions:

Write a query that generates a list of all products (id and name) purchased by Frugal Bike Shop, along with the total amount sold for each product.

  1. Use Sales.store table to find Store ID for the Frugal Bike Shop
  2. Join Sales.Customer to Sales.Store on s.BusinessEntityID = c.StoreID
  3. join Sales.SalesOrderHeader using CustomerID
  4. Join Sales.SalesOrderDetail using SalesOrderID
  5. From Sales.SalesOrderDetail you can extract ProductID, UnitPrice, OrderQty. To find total you have to multiply.
  6. Join Production, Product table to get product name
  7. Now you have all the data and can aggregate line-item total by ProductID and ProductName.
  8. Finally, you need to add Order by clause.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!