417 views

3 Answers

Best answer
2 votes
2 votes
Select Count (*) from T where B = 2 , this query returns false means returns 0 .

So the inner query of EXISTS returns a value 0 , it considered as true to EXISTS . Hence The main query " Select * from T where EXISTS " have true inner query so it returns  all the rows which is value 3 .

That means EXISTS selects all 3 rows as inner query returns true .
selected by
1 votes
1 votes
count value =0

exists gets a value 0(but not NULL) it got a value hence it becomes true.

hence 3 rows will be selected
0 votes
0 votes

if inner query is like this......(SELECT A from T where B = 2)

then in this case answer would be  "0" bcoz here inner query will return 'NULL' and it will be taken as false for EXISTS....

Answer:

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
1 answer
2
bhucho asked Sep 13, 2023
268 views
please can someone help with part (a) of this question.
0 votes
0 votes
1 answer
3
chinmay_rajpurohit asked Mar 2, 2023
661 views
2NF , 3NF, BCNF decomposition allowed if lossless and dependency preserving , both conditions must preserve. Otherwise given decomposition wrong for normal forms. Is this...