Direction: Consider the following relations A, B and C :
-
How many tuples does the result of the following SQL query contain?
SELECT A. Id
FROM A
WHERE A. Age > ALL (SELECT B. Age
FROM B
WHERE B. Name = ‘Arun’)
-
- 4
- 3
- 0
- 1
- 4
Correct Option: B
The meaning of "ALL" is the A. Age should be greater than all the values returned by the sub-query. There is no entry with name "arun" in table B. So the subquery will return NULL. If a sub-query returns an empty table or NULL, then the condition becomes true. Therefore, all the three row id's of A will be selected from table A.