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 Loyal (2.7k 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 (15.1k 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 Jun 2017
  1. Bikram

    3810 Points

  2. Arnab Bhadra

    1526 Points

  3. Hemant Parihar

    1502 Points

  4. Niraj Singh 2

    1491 Points

  5. Debashish Deka

    1434 Points

  6. junaid ahmad

    1432 Points

  7. pawan kumarln

    1278 Points

  8. Rupendra Choudhary

    1242 Points

  9. rahul sharma 5

    1236 Points

  10. Arjun

    1218 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 Jun 26 - Jul 02
  1. pawan kumarln

    410 Points

  2. Arjun

    258 Points

  3. akankshadewangan24

    254 Points

  4. Abhisek Das

    220 Points

  5. Debashish Deka

    188 Points


23,421 questions
30,139 answers
67,562 comments
28,469 users