TDS-C01 · Question #124
Which two types of aggregations can be applied to string fields? (Choose two.)
The correct answer is A. Minimum D. Count Distinct. Minimum works on strings because databases can compare them lexicographically (alphabetically), so the "minimum" value is simply the string that sorts first - no math required. Count Distinct works on any data type because it only needs to identify and tally unique values, not…
Question
Which two types of aggregations can be applied to string fields? (Choose two.)
Exhibit
Options
- AMinimum
- BSum
- CAverage
- DCount Distinct
How the community answered
(54 responses)- A94% (51)
- B4% (2)
- C2% (1)
Explanation
Minimum works on strings because databases can compare them lexicographically (alphabetically), so the "minimum" value is simply the string that sorts first - no math required. Count Distinct works on any data type because it only needs to identify and tally unique values, not perform arithmetic on them.
Sum (B) is wrong because adding strings mathematically is undefined - you can't sum "apple" and "banana." Average (C) is wrong for the same reason: computing a mean requires numerical division, which has no meaning for string values.
Memory tip: Ask yourself, "Does this operation require math?" Sum and Average do (add, divide) - strings can't do that. Minimum and Count Distinct only need comparison or counting, which work on any data type.
Topics
Community Discussion
No community discussion yet for this question.
