Which code segment should you execute?

You have a SQL Server 2012 database named Database1. Database1 contains a table
named OrderDetails.
For a given sales order, you need to retrieve the OrderID, Quantity, and LineTotal columns
for all of the items in the OrderDetails table. The solution must ensure that the results can be
joined to other tables.
Which code segment should you execute?

You have a SQL Server 2012 database named Database1. Database1 contains a table
named OrderDetails.
For a given sales order, you need to retrieve the OrderID, Quantity, and LineTotal columns
for all of the items in the OrderDetails table. The solution must ensure that the results can be
joined to other tables.
Which code segment should you execute?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 4

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


anon

anon

Shouldn’t the answer be D?

anon

anon

Sorry, I do not think D is correct. The ‘for a given’ piece is important. Although you would select from the view based on a where or a join, it is still missing ‘for a given’ in this limited context.

RW

RW

can not be B or D or C. C is missing “where OrderID=@OrderID”.
‘for the given’ orderID since View can not take parameter the answer should only be A. it table valued function and can be join to a table.