Question
For this assignment, continue to assume the role of a data analyst at Adventure Works Cycling Company. Your manager is waiting for you to deliver
For this assignment, continue to assume the role of a data analyst at Adventure Works Cycling Company. Your manager is waiting for you to deliver your analysis of why the company is losing money on its popular model "LL Road Frame-Black 60." As you are preparing your final report, your manager asks you to save your final queries from Topic 6 (the two nontemporary queries) as a stored procedure so you can periodically check on them from time to time. To do, you will need to complete the steps below.
Please note that when SQL queries are run, results are generated in the form of data. This data should be exported and saved to Excel for a visual check of accuracy.
Create Word document that includes the SQL query code used to explore the database tables.
- Drop all ORDER_BY statements from the query.
- Label one as PriceHistory723.
- Label the other as SalesOrderDetailbyDate723.
I am just wondering how to create stored procedure and get results. The one that I created only showed me the error "Commands completed successfully." and I got no actual results. I know how to make the temp tables in question, but I'm unsure how to create stored procedure using them. For background, here's the instructions for creating the Topic 6 tables referenced above:
- Combine MyProduct and MyPriceHistory displaying the fields into a new temporary table called MyProductPriceHistory. Display ProductID, Name, EndDate, and List Price.
- Combine MyProduct and MySalesOrderDetail displaying the fields into a new temporary table called MySalesOrderDetailbyName. Display ProductID, Name, SalesOrderID, and Quantity.
- Combine MySalesOrderDetailbyName and ALLSalesOrderDates displaying the fields into a new temporary table called MySalesHistory. Display ProductID, Name, OrderDate, and SumOfQuantity. This will require you using the SUM and GROUP BY statements.
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