DRAG DROP You create a table to track sales persons by running the following Transact-SQL statement:
You need to create a report that shows the sales people within each territory for each year. The report must display sales people in order by highest sales amount.
How should you complete the Transact-SQL statement? To answer, drag the appropriate Transact-SQL segments to the correct locations. Each Transact-SQL segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Answer:
Explanation:
Ranking rows results in the partition of a result set being returned. PARTITION BY divides the query result into partition. ORDER BY defines the logical order of the rows.
References: https://docs.microsoft.com/en-us/sql/t-sql/functions/rank-transact-sql?view=sql-server-2017
Leave a Reply