Home » Database » Database miscellaneous » Question

Database miscellaneous

  1. Consider the following database table named top_scorer.
    Player Country Goals
    Klose Germany 16
    Ronaldo Brazil 15
    G Muller Gemany 14
    Fontaine France 13
    Pele Brazil 12
    Klinsmann Germany 11
    Kocsis Hungary 11
    Batistuta Argentina 10
    Cubillas Peru 10
    Lato Poland 10
    Lineker England 10
    T Miller Germany 10
    Rahn Germany 10

    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 ________.
    1. 21
    2. 7
    3. 0
    4. 3
Correct Option: B

Consider the database table named top-scorer also consider the given SQL query is :
Select ta. Player from to P_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')
Then the number of tables are :

Hence 7 is the correct answer.



Your comments will be displayed only after manual approval.