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
3.5k views
in Programming by (106k points)
closed by

Comprehension

Consider the following relations A, B and C:

A

Id

Name

Age

12

Arun

60

15

Shreya

24

99

Rohit

11

 

B

Id

Name

Age

15

Shreya

24

25

Hari

40

98

Rohit

20

99

Rohit

11

 

C

Id

Phone

Area

10

2200

02

99

2100

01

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’)


1. 4
2. 3
3. 0
4. 1

1 Answer

0 votes
by (106k points)
selected by
 
Best answer
Correct Answer - Option 2 : 3

The correct answer is option 2.

The ALL keyword specifies that the search condition is TRUE if the comparison is TRUE for every value that the subquery returns. If the subquery returns no value, the condition is TRUE.

There is no Name='Arun' in the B table. So it returns no value then the condition become is TRUE for every row. So Finally it prints the ID of the A table.

Id

12

15

99

Hence the correct answer is 3.

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

...