Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

  1. Drop all ORDER_BY statements from the query.
  2. Label one as PriceHistory723.
  3. 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:

  1. Combine MyProduct and MyPriceHistory displaying the fields into a new temporary table called MyProductPriceHistory. Display ProductID, Name, EndDate, and List Price.
  2. Combine MyProduct and MySalesOrderDetail displaying the fields into a new temporary table called MySalesOrderDetailbyName. Display ProductID, Name, SalesOrderID, and Quantity.
  3. 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

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

Marketing Research An Applied Orientation

Authors: Naresh K Malhotra

6th edition

136085431, 978-0136085430

More Books

Students also viewed these Databases questions