โ† All SQL Flashcard Decks

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
  1. 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.

  2. 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.

  3. 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.

  4. Which statement removes a view named sales_summary?

    Answer: DROP VIEW sales_summary

    DROP VIEW deletes the view definition from the database.

  5. 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.

  6. 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.

  7. 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.