exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 189 discussion

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

DRAG DROP -
You develop a Microsoft SQL Server database for a sales ordering application.
You want to create a report that displays the increase of order quantities over the previous year for each product.
You need to write a query that displays:
✑ Product name,
✑ Year of sales order,
✑ Sales order quantity, and
✑ Increase of order quantity over the previous year.
Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-
SQL segments to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: FROM ..
Box 2: LAG (not LEAD)
Lag accesses data from a previous row in the same result set without the use of a self-join starting with SQL Server 2012 (11.x). LAG provides access to a row at a given physical offset that comes before the current row. Use this analytic function in a SELECT statement to compare values in the current row with values in a previous row.
Not lead: Lead accesses data from a subsequent row in the same result set without the use of a self-join starting with SQL Server 2012 (11.x). LEAD provides access to a row at a given physical offset that follows the current row.
Box 3: GROY BY PRO.NAME, YEAR (OrderDate)
References:
https://docs.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql?view=sql-server-2017

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
Dimples205
4 years, 8 months ago
Why is the FROM clause, first?
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 ...