edited by
583 views

2 Answers

Best answer
5 votes
5 votes
EXISTS return false if its input is $\emptyset$. In the given query, input to EXISTS is COUNT(*) which returns an integer value $\geq 0$, but never NULL. So, EXISTS always returns TRUE here and we get 3 rows in output.
selected by
1 votes
1 votes
In exists query we need to select an attribute but in above it is count(*) so no exists is taken it is executed as normal query which doesn't contain where condition so then it results all the 3 tuples

Related questions

0 votes
0 votes
0 answers
1
amitqy asked Jan 8, 2019
486 views
I got why query 2 is wrong. How do I approach to understand Query 1, is there a generic approach for solving questions like these which have no tables given?
1 votes
1 votes
1 answer
2
2 votes
2 votes
1 answer
3
nish kim asked Jan 19, 2018
397 views
0 votes
0 votes
0 answers
4