UpTest > Databases > MySQL Test

Test: MySQL Test

Question 1: Prev Next
Examine the data in the employees table given below:


last_name    department_id     salary

ALLEN         10                        3000

MILLER        20                      1500

King           20                     2200

Davis          30                      5000


Which of the following Subqueries will execute well?
Note: There may be more than one right answer.
SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department_id);
SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);
SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);
SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);
SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));
Please login to submit your answer.