How should you complete the query?

DRAG DROP

You have a table named Sales that contains the following data.

You need to query the table to return the average sales amount day. The output must produce the following results.

How should you complete the query? To answer, drag the appropriate values to the correct targets. Each value 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:

Box 1: SELECT

Box 2: GROUP BY

Example:

When used with a GROUP BY clause, each aggregate function produces a single value covering each group, instead of a single value covering the whole table. The following example produces summary values for each sales territory in the AdventureWorks2012 database. The summary lists the average bonus received by the sales people in each territory, and the sum of year-to-date sales for each territory.

SELECT TerritoryID, AVG(Bonus)as ‘Average bonus’, SUM(SalesYTD) as ‘YTD sales’ 

FROM Sales.SalesPerson 

GROUP BY TerritoryID; 

Reference: https://docs.microsoft.com/en-us/sql/t-sql/functions/avg-transact-sql

Latest DP-900 Dumps Valid Version with 134 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments