Querying Data with Transact-SQL — Question 53
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 database that is denormalized. Users make frequent changes to data in a primary table.
You need to ensure that users cannot change the tables directly, and that changes made to the primary table also update any related tables.
What should you implement?
Answer options
- A. the COALESCE function
- B. a view
- C. a table-valued function
- D. the TRY_PARSE function
- E. a stored procedure
- F. the ISNULL function
- G. a scalar function
- H. the TRY_CONVERT function
Correct answer: B
Explanation
Implementing a view allows you to create a layer over the tables, thereby preventing direct changes to the underlying tables while still reflecting updates from the primary table. The other options, such as functions or procedures, either do not provide the necessary abstraction to prevent direct table alterations or do not inherently synchronize changes across related tables.