โ† 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 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.

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

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

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

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

  6. Which DML operation may fail on a view containing DISTINCT?

    Answer: INSERT

    Views with DISTINCT are typically not updatable, so INSERT fails.

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