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 Loyal (3.6k points)   | 48 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 (15.4k 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 Aug 2017
  1. Bikram

    3584 Points


    3404 Points

  3. akash.dinkar12

    3030 Points

  4. manu00x

    2446 Points

  5. rahul sharma 5

    2260 Points

  6. makhdoom ghaya

    2040 Points

  7. just_bhavana

    1880 Points

  8. Tesla!

    1596 Points

  9. pawan kumarln

    1574 Points

  10. learner_geek

    1504 Points

24,796 questions
31,868 answers
30,011 users