Consider the following database table named top_scorer.
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta WHERE ta.goals > ALL ( SELECT tb.goals FROM top_scorer AS tb WHERE tb.country = 'Spain' ) AND ta.goals > ANY (SELECT tc.goals FROM top_scorer AS tc WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is ____.
Note: This questions appeared as Numerical Answer Type.
The query says we need to
- Condition 1: Select players which have goals greater than ALL players of spain – This conditon will always be true as ALL (empty) always returns TRUE.
- Condition 2: Any player of Germany having 10 goals, so all the rows which are greater than 10 Goals will be returned.
Therefore, option B is true.
Quiz of this Question
Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.