1. A university bookstore runs the same three-table join for orders in many applications and must hide payment columns from some roles. The join needs no parameters. Which object best centralizes this read logic?
- A stored procedure, because procedures are the only object that can join tables
- A view, because it encapsulates the join and can limit visible columns
- A DDL trigger, because triggers rewrite queries automatically
- A scalar function, because it returns a result set for joins
Show answer and explanation
- A view, because it encapsulates the join and can limit visible columns
A view stores a SELECT that joins base tables and can expose only safe columns, so callers query one object without learning the join or seeing hidden columns.