ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 18 - DP-900 discussion

Report
Export

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 per 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.


Question 18
Correct answer: Question 18

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

asked 02/10/2024
Miguel Triebel
36 questions
User
0 comments
Sorted by

Leave a comment first