Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Management has asked for a list of total year-to-date sales by each salesperson, with the salesperson having the highest dollar sales at the top. Each

Management has asked for a list of total year-to-date sales by each salesperson, with the salesperson having the highest dollar sales at the top. Each salesperson should be identified by his or her business entity ID, first name, and last name. You will create a query to display this summary and analyze the results.

  1. In the Object Explorer pane, scroll down in the list of tables under the AdventureWorks database until you see the Sales.SalesPerson table. Expand Sales.SalesPerson, and then under that, expand the Columns folder to see the list of columns in this table. You will refer to this list in composing your query.
  2. You may also need to refer to the column list for the Person.Person table to get the first and last names.
  3. Highlight and delete the code for your previous query, OR press Ctrl + N or click the New Query button to open a new query tab. Ensure that the AdventureWorks2008R2 database is still selected in the drop-down list at the upper left of the window.
  4. Referring to the list of columns, enter the SQL code for the desired query in the New Query pane on the right. Your query should display the BusinessEntityID, salesperson FirstName and LastName (from the Person.Person table), and SalesYTD, grouped by BusinessEntityID, FirstName, and LastName, and sorted so that the highest SalesYTD appears at the top. Refer to the query in the previous step for an example of the SQL code for a similar query.
  5. Click the ! Execute button on the toolbar to execute this query. Results will be displayed at the bottom of the Query window.
  6. what is the correct SQL code for this? not getting results from : SELECT BusinessEntityID,FirstName,LastName, sum(SalesYTD) as Sum_of_SalesYTD

FROM Person.Person

JOIN Sales.SalesPerson P ON S.ProductID= P.ProductID

GROUP BY BusinessEntityID,FirstName,LastName

ORDER BY Sum_of_SalesYTD DESC;

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

Quantitative Credit Portfolio Management

Authors: Arik Ben Do, Lev Dynkin, Jay Hyman, Bruce D. Phelps

1st Edition

1118117697, 978-1118117699

More Books

Students also viewed these General Management questions

Question

Explain all drawbacks of the application procedure.

Answered: 1 week ago

Question

Determine Leading or Lagging Power Factor in Python.

Answered: 1 week ago

Question

LO3 Describe the two most common methods of applying for a job.

Answered: 1 week ago

Question

LO1 Explain the strategic importance of the recruitment function.

Answered: 1 week ago