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 clause prevents an INSERT or UPDATE through a view from producing rows that the view itself cannot select?
Answer: WITH CHECK OPTION
WITH CHECK OPTION enforces that modified rows still satisfy the view's WHERE condition.
What does CREATE OR REPLACE VIEW do if the view already exists?
Answer: Redefines the existing view
CREATE OR REPLACE VIEW redefines the view in place without dropping it first.
A view defined as SELECT col FROM t WHERE x > 5 is generally updatable only if it references how many base tables?
Answer: One
Simple updatable views typically map to a single underlying base table.
Which statement removes a view named sales_summary?
Answer: DROP VIEW sales_summary
DROP VIEW deletes the view definition from the database.
What happens to the data in base tables when a view is dropped?
Answer: It remains unchanged
Dropping a view removes only the stored query, not the underlying data.
Which feature lets a view physically store its query results for faster reads?
Answer: Materialized view
A materialized view caches the result set on disk and is refreshed periodically.
Why might you create a view that selects only certain columns of a table?
Answer: To restrict column access for security
Column-limited views hide sensitive columns while exposing only needed data.