Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
Views are virtual tables defined by queries. A common use case is to present derived or computed results—such as totals, formatted values, or conditional labels—without asking application code to repeat the same expressions everywhere. This question checks whether views can legitimately expose computed values to consumers.
Given Data / Assumptions:
Concept / Approach:
Because a view definition is a SELECT statement, any expression allowed in SELECT—arithmetic, string functions, CASE, date math, aggregates with GROUP BY (subject to updatability differences), and window functions—can be projected as a column in the view. Consumers query the view and receive the computed results as if they were columns, improving consistency and encapsulation.
Step-by-Step Solution:
Verification / Alternative check:
Many systems also support materialized views that persist results; both standard (virtual) and materialized views can include computed expressions, though refresh strategies differ.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing display of computed values (supported) with updating them (often not supported). Assuming views must store results—virtual views compute on demand.
Final Answer:
Correct
Discussion & Comments