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
Should be D
not D, need to retrieve info for just one order.
Damn. This one’s tricky.
I’m gonna say D. Technically a function would retrieve one for just one order and could be hooked up to a query via APPLY.
But the question specifically mentions JOIN ing. And you can always just use a where clause on a view to limit it to an order…