ExamCompetition Forum Question Papers Ask A Question Mock Test Learn & Earn Sign Up Login Menu



0 vote

Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.The SQL statementSELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);prints

Asked on by | Votes 0 | Views: 218 | Tags: computer science     | sql     | sql basics     | Add Bounty

Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.The SQL statementSELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);prints

A).  10

B).  9

C).  5

D).  0


Share on Facebook      Share on Whatsapp       Share on Twitter




1 answers

-1 vote
Answered by on | Votes -1 |

 9



ANY compares a value with each of the values in a list or results from a query and evaluates to true if the result of an inner query contains at least one row. ANY must be preceded by comparison operators(=, >, <, <=, >=, <>).

Employee table has 10 records and each value in non-NULL SALARY column is unique i.e different. So, in that 10 records one of the record will be minimum which cannot be greater than any nine value of the salary column. Hence the condition
WHERE SALARY > ANY (SELECT SALARY FROM employee)
will be true nine times. So, the COUNT(*) outputs 9.

Join Telegram Group




Answer This Question

Name:
Email:
Answer :
Sum of (5+4)
Submit: