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.
Box 1: SELECT
Box 2: GROUP BY
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’
GROUP BY TerritoryID;