exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 50 discussion

Actual exam question from Microsoft's 70-761
Question #: 50
Topic #: 1
[All 70-761 Questions]

DRAG DROP -
Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question in this series.
You are developing a database to track customer orders. The database contains the following tables: Sales.Customers, Sales.Orders, and Sales.OrderLines. The following table describes the columns in Sales.Customers.

The following table describes the columns in Sales.Orders.

The following table describes the columns in Sales.OrderLines.

You need to create a function that accepts a CustomerID as a parameter and returns the following information:
✑ all customer information for the customer
the total number of orders for the customer

✑ the total price of all orders for the customer
✑ the average quantity of items per order
How should you complete the function definition? To answer, drag the appropriate Transact-SQL segment to the correct locations. Transact-SQL segment 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.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box1: RETURNS TABLE -
The function should return the following information:
✑ all customer information for the customer
✑ the total number of orders for the customer
✑ the total price of all orders for the customer
✑ the average quantity of items per order

Box 2: COUNT -
The function should return the total number of orders for the customer.

Box 3: SUM -
The function should return the total price of all orders for the customer.

Box 3. AVG -
The function should return the average quantity of items per order.

Box 4: GROUP BY -
Need to use GROUP BY for the aggregate functions.
References:
https://msdn.microsoft.com/en-us/library/ms186755.aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
binbashir22
4 years, 5 months ago
I agree
upvoted 1 times
...
lh2607
4 years, 6 months ago
Correctimundo
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...