Problem Statement
Why expose a VIEW to consumers instead of the base table?
Explanation
Grant SELECT on a view while denying base tables. This hides sensitive columns, encodes business rules, and narrows the surface area for callers.
Code Solution
SolutionRead Only
CREATE VIEW v_orders_public AS SELECT id, created_at, total FROM orders WHERE status <> 'DELETED';
Practice Sets
This question appears in the following practice sets:
