First time here? Checkout the FAQ!
0 votes

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

asked in Databases by Active (2.3k points)   | 41 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.7k 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 Feb 2017
  1. Arjun

    5274 Points

  2. Bikram

    4230 Points

  3. Habibkhan

    3842 Points

  4. Aboveallplayer

    3086 Points

  5. Debashish Deka

    2378 Points

  6. sriv_shubham

    2308 Points

  7. Smriti012

    2236 Points

  8. Arnabi

    2008 Points

  9. sh!va

    1672 Points

  10. mcjoshi

    1640 Points

Monthly Topper: Rs. 500 gift card

20,846 questions
26,001 answers
22,098 users