Difficulty: Easy
Correct Answer: Both columns/rows and complicated SQL syntax
Explanation:
Introduction / Context:
Views are named, stored queries that expose a tailored, virtual table to consumers. They are a core abstraction that improves security, simplicity, and reuse.
Given Data / Assumptions:
Concept / Approach:
Views can both restrict data visibility (project fewer columns and select specific rows) and hide complexity (joins, CASE logic, window functions, calculations). This shields application code and users from writing repetitive, error-prone SQL and supports security by exposing only what is necessary.
Step-by-Step Solution:
Verification / Alternative check:
Role-based permissions granted on the view (but not the base tables) enforce column/row-level exposure, while keeping query logic centralized.
Why Other Options Are Wrong:
Columns and rows only: Ignores the complexity-hiding benefit.
Complicated SQL syntax only: Ignores security/visibility filtering.
None of the above / Only physical storage: Views are independent of physical storage; they provide logical abstraction.
Common Pitfalls:
Assuming views automatically enforce row-level security without proper GRANT/REVOKE; permissions must be configured correctly.
Final Answer:
Both columns/rows and complicated SQL syntax
Discussion & Comments