GATE CSE
First time here? Checkout the FAQ!
x
0 votes
44 views

How many rows will be there in the output of the following query?

asked in Databases by Active (2.3k points)   | 44 views

1 Answer

+1 vote
The second query always returns 0.

Thus, the table returned by second query consists of 1 tuple.

 

Now, exists( table containing single tuple)= true for every employee of 1st relation.

 

Thus, bove query will return all the tuples of the 1st relation.
answered by Veteran (14.8k points)  

So it means that whenever we have an internal query consisting of count() then in case of exists we will always get all tuples because count always return an integer  value.

plz varify?

Yes, I suppose that count() will always return an integer. But, today I will execute the query and let you know the actual outcome.


Top Users Mar 2017
  1. rude

    5236 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2732 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1440 Points

  8. Bikram

    1428 Points

  9. Akriti sood

    1420 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,551 questions
26,896 answers
61,256 comments
23,267 users