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. 0The subquery (SELECT SALARY FROM EMPLOYEE) returns all salary values from the employee table. The condition SALARY > ALL (...) means that the salary must be…

  1. A.

    10

  2. B.

    9

  3. C.

    5

  4. 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.

Explore the full course: Wipro Preparation

Loading lesson…