Examine the description of the EMPLOYEES table:
Which two queries will execute successfully? (Choose two.)
Examine the description of the EMPLOYEES table:
Which two queries will execute successfully? (Choose two.)
The query 'SELECT dept_id, SUM(salary) FROM employees WHERE hire_date > '01-JAN-19' GROUP BY dept_id;' will execute successfully. The query satisfies the SQL query rules where a GROUP BY clause is used with a valid aggregate function (SUM) without any nested aggregate functions. The other proposed queries will not execute successfully due to improper use of nested aggregate functions or incorrect usage of GROUP BY clauses.
I think answer B is the only correct answer because In SQL, a group function operates on a set of rows and returns a single value for each group. Group functions include AVG, COUNT, MAX, MIN, and SUM. These functions cannot be nested within one another. For example, in query A, the AVG function is nested within the MAX function which is not allowed. Similarly, in query C, D and E, the MAX function is nested within the AVG function which is also not allowed. What do you think?
BE is the correct answer
BE tested
Tested. A. not a GROUP BY expression C.D boths are not a single-group group function
BE tested
C works.
ORA-00937: not a single-group group function