Gate2017 ss Q59

0. Consider the following database table named top_scorer.

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 – Numerical Type question

  • Option : C
  • Explanation :
    in this 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.
    AND
    Condition 2: Any player of Germany having 10 goals, so all the rows which are greater than 10 Goals will be returned.
    Looking at the table, first 7 rows satisfy both the conditions.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *