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.
- Use Sales.store table to find Store ID for the Frugal Bike Shop
- Join Sales.Customer to Sales.Store on s.BusinessEntityID = c.StoreID
- join Sales.SalesOrderHeader using CustomerID
- Join Sales.SalesOrderDetail using SalesOrderID
- From Sales.SalesOrderDetail you can extract ProductID, UnitPrice, OrderQty. To find total you have to multiply.
- Join Production, Product table to get product name
- Now you have all the data and can aggregate line-item total by ProductID and ProductName.
- Finally, you need to add Order by clause.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
