Table employees has 10 records. It has a non-NULL SALARY column which is also…
2025
Table employees has 10 records. It has a non-NULL SALARY column which is also UNIQUE. The SQL statement
SELECT COUNT(*)
FROM EMPLOYEE
WHERE SALARY > ALL (SELECT SALARY FROM EMPLOYEE);
- A.
10
- B.
9
- C.
5
- D.
0
Attempted by 209 students.
Show answer & explanation
Correct answer: D
The subquery (SELECT SALARY FROM EMPLOYEE) returns all salary values from the table. The condition SALARY > ALL(...) means the salary must be greater than every value returned by the subquery. Since the SALARY column is UNIQUE and non-NULL, no salary can be greater than all salaries in the table, including itself. Therefore, no row satisfies the condition, and COUNT(*) returns 0.