A database table is defined as employees(emp_id, emp_name, salary). Which of the following SQL queries correctly lists the names of all employees who earn MORE than the average salary of all the employees in the table?
SELECT emp_name FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
SELECT emp_name FROM employees WHERE salary > AVG(salary);
SELECT emp_name FROM employees HAVING salary > AVG(salary);
SELECT AVG(salary) FROM employees WHERE salary > emp_name;
The verified answer and full solution are one login away
Every answer here is machine verified, with a step-by-step solution that teaches the method. Your login also unlocks a 7-question mock preview in the real exam interface.
Log in to see the answerMore sql questions