Difficulty: Easy
Correct Answer: Incorrect
Explanation:
Introduction / Context:
Views encapsulate SELECT queries. The question asks whether SQL-92 prohibits GROUP BY in view definitions. Understanding the difference between “can define” versus “can update through” is essential: aggregation affects updatability, not definability.
Given Data / Assumptions:
Concept / Approach:
SQL-92 allows views to be defined using arbitrary SELECT statements, which may include GROUP BY. However, views that perform aggregation are typically not inherently updatable because grouping destroys the one-to-one correspondence with base rows. Hence, the statement that standard views are constructed only from SELECT without GROUP BY is incorrect; GROUP BY is allowed but usually produces a non-updatable view.
Step-by-Step Solution:
Verification / Alternative check:
Try CREATE VIEW v AS SELECT dept_id, COUNT(*) AS c FROM emp GROUP BY dept_id; — this is valid in mainstream SQL systems, though INSERT/UPDATE via v will be restricted.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing syntactic allowance with updatability; assuming anything not updatable is disallowed in a view definition.
Final Answer:
Incorrect
Discussion & Comments