Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started