Developing SQL Databases — Question 31

You have a view that includes an aggregate.
You must be able to change the values of columns in the view. The changes must be reflected in the tables that the view uses.
You need to ensure that you can update the view.
What should you create?

Answer options

Correct answer: B

Explanation

Creating a schema-bound view ensures that the underlying tables cannot be modified in a way that would invalidate the view, allowing for updates to propagate back to the base tables. The other options do not provide the necessary guarantees for maintaining this integrity while allowing updates: a nonclustered index improves performance, a stored procedure is a separate executable logic that doesn’t directly enable updates, and an INSTEAD OF trigger modifies behavior on data modifications but does not inherently ensure the view's structure integrity.