View Management Flashcards
7 cards from real SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 View Management flashcards as text
Which keyword in some databases lets you alter a view's definition without dropping dependents?
Answer: ALTER VIEW
ALTER VIEW changes the view definition while preserving privileges and dependencies.
A view with WITH CHECK OPTION rejects an UPDATE that would do what?
Answer: Move a row outside the view's WHERE filter
CHECK OPTION blocks updates that would make a row fail the view's condition.
Which scenario is a strong use case for a materialized view?
Answer: Expensive aggregation queried frequently on slowly changing data
Materialized views shine for costly aggregations over data that changes infrequently.
What is the main security advantage of granting access to a view instead of base tables?
Answer: Users see only the rows and columns the view exposes
Views can restrict visible rows and columns, providing fine-grained access control.
When you query a non-materialized view, when is its underlying SELECT executed?
Answer: Each time the view is queried
A regular view runs its defining query every time it is accessed.
Which DML operation may fail on a view containing DISTINCT?
Answer: INSERT
Views with DISTINCT are typically not updatable, so INSERT fails.
What does it mean that a view provides 'logical data independence'?
Answer: Base table changes can be hidden from applications by the view
Views can shield applications from underlying schema changes, giving logical independence.