Querying Data with Transact-SQL — Question 87

Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.
You have a table named Person that contains information about employees. Users are requesting a way to access specific columns from the Person table without specifying the Person table in the query statement. The columns that users can access will be determined when the query is running against the data. There are some records that are restricted, and a trigger will evaluate whether the request is attempting to access a restricted record.
You need to ensure that users can access the needed columns while minimizing storage on the database server.
What should you implement?

Answer options

Correct answer: B

Explanation

The correct answer is B, a view, as it allows users to access specific columns from the Person table without directly referencing the table itself. Other options like functions or stored procedures do not provide the same level of abstraction for column selection and may not be suitable for minimizing storage or controlling access in the same way that a view does.