Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
The relational model views query outputs as relations (tables). SQL adopts this notion with “result sets.” This question checks whether you understand that regardless of complexity—joins, aggregates, subqueries—the SELECT statement returns a table-like structure.
Given Data / Assumptions:
Concept / Approach:
Every SELECT produces a rectangular result: zero or more rows and one or more columns, each column having a defined type. Even SELECT without FROM (in some DBMSs) returns a single-row, single-column table. ORDER BY can change presentation order, but the underlying structure remains a table. This property enables composability: nesting a SELECT inside another or materializing it as a view.
Step-by-Step Solution:
Verification / Alternative check:
Wrap any SELECT as a derived table: SELECT * FROM (SELECT 1 AS n) AS q; The inner SELECT is a table expression, proving tabular output.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing scalar functions with queries; while functions can return a value, a SELECT’s output is a rowset even if it contains one row and one column.
Final Answer:
Correct
Discussion & Comments