Interpreting a HAVING clause with a subquery

A table employees(emp_id, dept, salary, hire_year) holds one row per employee. Consider this query:


SQL
SELECT   dept, AVG(salary) AS avg_sal
FROM     employees
WHERE    hire_year >= 2020
GROUP BY dept
HAVING   AVG(salary) > (SELECT AVG(salary) FROM employees);


Which of the following statements about this query are true? Select all that apply.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Advanced Queries Questions: