Querying Data with Transact-SQL — Question 47
You need to create an indexed view that requires logic statements to manipulate the data that the view displays.
Which two database objects should you use? Each correct answer presents a complete solution.
Answer options
- A. a user-defined table-valued function
- B. a CRL function
- C. a stored procedure
- D. a user-defined scalar function
Correct answer: A, C
Explanation
The correct answers are A and C. A user-defined table-valued function can return a result set that can be indexed, while a stored procedure can perform complex operations and return data, making both suitable for creating an indexed view. Options B and D do not meet the requirements as a CRL function is not a recognized SQL function type, and a user-defined scalar function returns a single value, not a result set.