Which SQL query should you use?

You work for a company that sells books. You are creating a report for a SQL Server 2005 database. The report will list sales representatives and their total sales for the current month. The report must include only those sales representatives who met their sales quota for the current month. The monthly sales quota is $2,000. The date parameters are passed in variables named @FromDate and @ToDate.
You need to create the report so that it meets these requirements. Which SQL query should you use?

You work for a company that sells books. You are creating a report for a SQL Server 2005 database. The report will list sales representatives and their total sales for the current month. The report must include only those sales representatives who met their sales quota for the current month. The monthly sales quota is $2,000. The date parameters are passed in variables named @FromDate and @ToDate.
You need to create the report so that it meets these requirements. Which SQL query should you use?

A.
SELECT s.AgentName, SUM(ISNULL(o.OrderTotal,0.00))AS SumOrderTotalFROM SalesAgent s JOIN OrderHeader o ON s.AgentID = o.AgentIDWHERE o.OrderDate BETWEEN @FromDate AND @ToDateGROUP BY s.AgentName

B.
SELECT s.AgentName, SUM(ISNULL (o.OrderTotal,0.00))AS SumOrderTotalFROM SalesAgent s JOIN OrderHeader o ON s.AgentID =

C.
AgentIDWHERE o.OrderDate BETWEEN @FromDate AND @ToDate AND

D.
OrderTotal >= 2000GROUP BY s.AgentName

E.
SELECT s.AgentName, SUM(ISNULL (o.OrderTotal,0.00)) AS SumOrderTotalFROM SalesAgent s JOIN OrderHeader o ON s.AgentID = o.AgentID WHERE o.OrderDate BETWEEN @FromDate AND @ToDateGROUP BY

F.
AgentNameHAVING SUM(o.OrderTotal) >= 2000

G.
SELECT s.AgentName, SUM(ISNULL(o.OrderTotal,0.00)) AS SumOrderTotalFROM SalesAgent s JOIN OrderHeader o ON s.AgentID =

H.
AgentIDWHERE o.ordertotal = 2000 AND o.OrderDate BETWEEN @FromDate AND @ToDateGROUP BY s.AgentNameHAVING SUM(o.OrderTotal) >= 2000



Leave a Reply 0

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