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
A. 10
B. 9
C. 5
D. 0
Answer: Option D
Solution(By Examveda Team)
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.Related Questions on Sql Miscellaneous
A. Structured Query Language
B. Structured Query List
C. Simple Query Language
D. None of these
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
A. Data Definition Language(DDL)
B. Data Manipulation Language(DML)
C. Both of above
D. None
Which operator performs pattern matching?
A. BETWEEN operator
B. LIKE operator
C. EXISTS operator
D. None of these
What operator tests column for the absence of data?
A. EXISTS operator
B. NOT operator
C. IS NULL operator
D. None of these
Join The Discussion