Table employee has 10 records. It has a non-NULL SALARY column which is also…
20252025
Table employee 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);
prints
Answer: D. 0 — The subquery (SELECT SALARY FROM EMPLOYEE) returns all salary values from the employee table. The condition SALARY > ALL (...) means that the salary must be…
- A.
10
- B.
9
- C.
5
- D.
0
Attempted by 361 students.
Show answer & explanation
Correct answer: D
The subquery (SELECT SALARY FROM EMPLOYEE) returns all salary values from the employee table. The condition SALARY > ALL (...) means that 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.