Difficulty: Easy
Correct Answer: Incorrect
Explanation:
Introduction / Context:
Aggregates compress sets of rows into summarized results. Understanding the difference between scalar aggregates and grouped aggregates is essential for reading query plans and designing reports. This item misstates the definition of a scalar aggregate.
Given Data / Assumptions:
Concept / Approach:
A scalar aggregate returns exactly one row with one or more aggregate expressions summarizing the entire input set (for example, SELECT COUNT() FROM T;). In contrast, a grouped aggregate returns one result per group (for example, SELECT dept, COUNT() FROM T GROUP BY dept;). Therefore, calling a scalar aggregate “multiple values” is incorrect—scalar aggregates yield a single result set row (though that row can contain multiple aggregate columns).
Step-by-Step Solution:
Verification / Alternative check:
Running the examples shows the row counts: scalar = 1 row; grouped = many rows.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing “one row per query” with “one column”—a scalar aggregate can include multiple aggregate columns but still returns a single row.
Final Answer:
Incorrect
Discussion & Comments