Relational Databases — What Is a SQL View? Which description correctly identifies a view in SQL and how it is accessed?

Difficulty: Easy

Correct Answer: A virtual table that can be accessed via SQL commands

Explanation:


Introduction:
A view is a powerful logical construct in relational databases that provides a named query result as if it were a table. Views are essential for abstraction, security, and simplifying complex queries by encapsulating joins and filters behind a stable name.


Given Data / Assumptions:

  • Standard SQL supports CREATE VIEW and allows querying views with SELECT (and sometimes DML under constraints).
  • Views are commonly non-materialized logical definitions; some systems also support materialized views.
  • The question targets the core idea of a view, not advanced variants.


Concept / Approach:
Conceptually, a view is a saved SELECT statement. When you query the view, the DBMS typically expands or rewrites the query into the underlying base tables. Because it is logical, a view is not a base table by default and does not store data permanently (unless it is a materialized view, which is a separate feature in many systems).


Step-by-Step Solution:
1) Identify whether a view is base or virtual: it is virtual by default.2) Determine whether it is accessible via SQL: yes, views are queried with standard SQL statements.3) Therefore, the correct description is a virtual table accessible through SQL.


Verification / Alternative check:
DBMS documentation shows CREATE VIEW syntax and demonstrates SELECT * FROM MyView; operating identically to tables from a user perspective for read operations, subject to permissions.


Why Other Options Are Wrong:

  • Cannot be accessed via SQL: False; SQL is the interface.
  • Base table: A base table is physically stored; a normal view is not.
  • Permanent physical copy only: That describes materialized views, which are distinct from standard logical views.


Common Pitfalls:
Confusing standard views with materialized views, or assuming all views are updatable. Updatability and performance depend on DBMS rules and the view definition.


Final Answer:
A virtual table that can be accessed via SQL commands

Discussion & Comments

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