SIMULATION -
You have a database that contains the following tables.
You need to create a query that lists the highest-performing salespersons based on the current year-to-date sales period. The query must meet the following requirements:
✑ Return the LastName and SalesYTD for the three salespersons with the highest year-to-date sales values.
✑ Exclude salespersons that have no value for TerritoryID.
Construct the query using the following guidelines:
✑ Use the first letter of a table name as the table alias.
✑ Use two-part column names.
✑ Do not surround object names with square brackets.
✑ Do not use implicit joins.
✑ Use only single quotes for literal text.
Use aliases only if required.
Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within the code that has been provided as well as below it.
1 SELECT top 3 lastname,salesYTD
2 FROM Person AS p INNER JOIN SalesPerson AS s
3 ON p.PersonID = s.SalesPersonID
4 WHERE territoryid is null
5 order by salesytd dsec
Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position.
MarcusJB
Highly Voted 4 years, 11 months agoBenAsare
Highly Voted 5 years, 5 months agoanonimdom
5 years, 3 months agoAndy7622
4 years, 4 months agoVermonster
Most Recent 4 years, 4 months agojortizhuedo
5 years, 1 month agomattia_88
5 years, 6 months agoJiacheng
5 years, 2 months agoBartek
5 years, 7 months agoAndy7622
4 years, 4 months ago