1Z0-909 practice question 5 of 15
Which two statements are true about aggregate functions?
Full set: 65 questionsIn MySQL 8.0 aggregate functions return NULL when the query produces no rows; this is explicitly stated for MAX(). COUNT(DISTINCT) excludes NULLs, while AVG() and SUM() accept the DISTINCT modifier in ordinary aggregation. When an aggregate is used as a window function (MIN() … OVER()), the DISTINCT keyword is forbidden by syntax rules. Therefore, only “MAX() returns NULL if there are no rows” and “MIN() cannot use DISTINCT when it executes as a window function” are true.
A. SUM() returns NULL—not 0—when the result set is empty.
C. COUNT(DISTINCT) ignores NULL values; they are not included in the count.
E. AVG() syntax permits the DISTINCT keyword in normal (non-window) aggregation.
1. MySQL 8.0 Reference Manual, 12.20 Aggregate (GROUP BY) Functions – “If there are no matching rows, the result is NULL for functions such as SUM(), AVG(), MAX(), MIN().” (Oracle, 2023).
2. MySQL 8.0 Reference Manual, 12.20.2 COUNT() Aggregate Function – “COUNT(DISTINCT expr) returns the number of distinct non-NULL values.”
3. MySQL 8.0 Reference Manual, 12.21.1 Window Function Descriptions – “DISTINCT and ORDER BY are not permitted within the argument list of an aggregate function when it is used as a window function.”
Keep practicing
Take the free 1Z0-909 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-909 practice questions
- Question 3Examine these commands which execute successfully: mYsql> CREATE TABLE income (acct_num I…
- Question 4Examine this statement which executes successfully: CREATE TABLE 'fshop’ ('product' JSON …
- Question 6Examine this statement and output: CREATE TABLE geom (g GEOMETRY NOT NOLL, SPATIAL INDEX(…
- Question 12You are using buffered queries with PHP mysqli in a browser-based web application. Which …
