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

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

asked in Databases by Active (2.4k points)   | 47 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 (15k 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 May 2017
  1. akash.dinkar12

    3154 Points

  2. pawan kumarln

    1630 Points

  3. sh!va

    1590 Points

  4. Arjun

    1350 Points

  5. Devshree Dubey

    1246 Points

  6. Angkit

    1044 Points

  7. Debashish Deka

    1022 Points

  8. Bikram

    972 Points

  9. LeenSharma

    836 Points

  10. Prashant.

    692 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 22 - 28
  1. pawan kumarln

    256 Points

  2. Ahwan

    236 Points

  3. jjayantamahata

    114 Points

  4. joshi_nitish

    114 Points

  5. Arnab Bhadra

    94 Points


22,731 questions
29,061 answers
65,101 comments
27,627 users