ExamVeda
Login
Home
This question belongs to SQL Sql Miscellaneous
Sql Miscellaneous
?

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 & Solution
Correct Answer: Option D
In this statement, you are comparing the SALARY column of each employee with the result of the subquery that selects all SALARY values from the same table. Since the SALARY column is unique, there is no salary greater than ALL the salaries in the same table, including itself. Therefore, the condition SALARY > ALL (SELECT SALARY FROM EMPLOYEE) will always be false for all records, resulting in a count of 0.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.