What do we call an SQL virtual table constructed from one or more base tables using a saved SELECT definition?

Difficulty: Easy

Correct Answer: A view

Explanation:


Introduction / Context:
Views are a core abstraction in SQL that present data from base tables through a stored query, often to simplify access or enforce security.



Given Data / Assumptions:

  • A virtual table is mentioned.
  • The definition is created from other tables via a SELECT.


Concept / Approach:
A view is defined with CREATE VIEW ... AS SELECT ... and behaves like a table in queries, though it does not store its own data (except materialized variants). It is distinct from ad hoc query results, which are transient.



Step-by-Step Solution:

Identify keywords “virtual table” and “constructed from other tables.”Associate with the SQL object “view.”Select “A view.”


Verification / Alternative check:
Attempt SELECT * FROM view_name after creation; this works like selecting from a table.



Why Other Options Are Wrong:

  • “Just another table”: physical tables store rows; a view is virtual.
  • “A relation”: generic term for a table, not specific to virtual constructs.
  • “Query results”: ephemeral; a view is persistent metadata.


Common Pitfalls:
Assuming views permanently store data; unless materialized, they compute results at query time.



Final Answer:
A view

Discussion & Comments

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