Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
158 views
in Programming by (85.3k points)
closed by

Consider the following database table named top_scorer.

Top_scorer

player

country

Goals

Klose

Germany

16

Ronaldo

Brazil

15

G miller

Germany

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 Answer

0 votes
by (88.5k points)
selected by
 
Best answer

Here first condition results in the players where goals greater than all the player of spain. But there are no players of spain. So, this will result in all the players. Result of first query is:

player

Klose

Ronaldo

G miller

Fontaine

Pele

Klinsmann

Kocsis

Batistuta

Cubillas

Lato

Lineker

T Miller

Rahn

 

Second condition results in player who have goals greater than goals of any player of Germany.

At the last result, it results in 7 tuples.

Player

Klose

Ronaldo

G miller

Fontaine

Pele

Klinsmann

Kocsis

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...