Which five Transact-SQL segments should you use to deve…

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 calculates the highest tax rate charged for an item in a specific order.
Which five 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:

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 calculates the highest tax rate charged for an item in a specific order.
Which five 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:

Answer:

Explanation:
Box1: CREATE FUNCTION…@OrderID
Include definition for the …@OrderID parameter.
Box 2: RETURNS decimal(18,2)
The function is defined to return a scalar value.
Box 3: AS BEGIN …
Declare the local variables of the function.
Box 4: SET @CalculatedTaxRate = (..
Calculate the tax rate.
Box 5: RETURN @CalculatedRate END
Return a scalar value.
https://msdn.microsoft.com/en-us/library/ms186755.aspx



Leave a Reply 2

Your email address will not be published. Required fields are marked *


scotrid

scotrid

the code is wrong ! but answer is OK