What should you do?

You are a database developer. You plan to design a database solution by using SQL Server 2008. Account managers in your company store order data in a database. Your company requires a list of customers for each account manager. The list must be sorted in the descending order of the order amount. You create a query that generates the list at the end of each month. You need to ensure that the query executes as quickly as possible. What should you do?

You are a database developer. You plan to design a database solution by using SQL Server 2008. Account managers in your company store order data in a database. Your company requires a list of customers for each account manager. The list must be sorted in the descending order of the order amount. You create a query that generates the list at the end of each month. You need to ensure that the query executes as quickly as possible. What should you do?

A.
Create a cursor that returns each account manager, and then sort the order data by order amount.

B.
Use a SELECT statement that uses the OVER clause to rank the customers by order amount for eachaccount manager.

C.
Create a correlated subquery to return the order amount for each account manager.Sort the results first by account manager and then by order amount.

D.
Create a table-valued function that returns the order amount for a specific account manager, and thencreate a query by using the CROSS APPLY clause to list each account manager.Sort the results first by account manager and then by order amount.



Leave a Reply 0

Your email address will not be published. Required fields are marked *