Views and data storage — evaluate the assertion:\n“An updatable view has its own data.”\nDecide whether this statement is correct or incorrect, distinguishing virtual views from materialized views.

Difficulty: Easy

Correct Answer: Incorrect

Explanation:


Introduction / Context:
SQL views are commonly used to encapsulate queries, simplify security, and present tailored schemas to applications. The statement claims that an updatable view “has its own data,” which probes understanding of virtual versus materialized storage and how updates are propagated.



Given Data / Assumptions:

  • A standard (virtual) view is defined by CREATE VIEW AS SELECT ...
  • Updatability depends on query properties (e.g., single base table, key preservation) and vendor rules.
  • Materialized views (or indexed views) exist in some systems but are distinct from ordinary views.


Concept / Approach:
Virtual views do not store their own data; they present results computed from base tables at query time. When a virtual view is updatable, DML statements on the view are translated into DML on the underlying tables (sometimes with INSTEAD OF triggers). Only materialized views persist physical data, but even then the source of truth is the base tables. Therefore, saying an “updatable view has its own data” is incorrect in the ordinary sense of SQL views.



Step-by-Step Solution:

Differentiate view types: virtual vs materialized.Assess updatability rules: view DML maps to base tables; the view itself holds no independent tuples.Conclude: the claim is incorrect for standard updatable (virtual) views.Note: materialized/Indexed views persist data but remain derived from base tables.


Verification / Alternative check:
Execute INSERT/UPDATE on a simple updatable view; observe changes in the base table. Dropping the base table invalidates the view, revealing that the view has no independent data store.



Why Other Options Are Wrong:

  • “Correct” misstates how views work.
  • “Depends on primary key/trigger/clustered index” mixes factors that affect updatability or performance, not whether a view stores data.


Common Pitfalls:
Confusing materialized views with ordinary views; assuming that because a view is updatable it must retain its own copy of data.



Final Answer:
Incorrect

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion