@juniorG In that case we would get an empty set, and no tuples will be eventually returned.

> i was wondering if it’d behave like ANY/ALL in case of an empty set

What do you mean by this?

Dark Mode

0 votes

Consider the following relations:

How many number of records will be returned by the following query?

@juniorG In that case we would get an empty set, and no tuples will be eventually returned.

> i was wondering if it’d behave like ANY/ALL in case of an empty set

What do you mean by this?

0

@palashbehra5 so the answer would be zero if count(*) wasn’t mentioned? do you have any resource for this?

also, ALL returns true in empty set and ANY returns false, so i thought it’d applicable here as well?

https://gateoverflow.in/95059/Working-of-any-and-all-with-empty-set

0

@juniorG Not a resource really but for most the SQL doubts, use any online SQL query interpreter.

Now, without count.

The only reason behind it that the type of output inner queries give in both cases. in the case of count(*), the inner query returns a scalar quantity, which is not empty but in the second case where it was supposed to return tuples, it returns an empty set.

> also, ALL returns true in the empty set, and ANY returns false, so I thought it’d be applicable here as well?

Yes, sort of. EXISTS with an empty set will select no tuples and NOT EXISTS will select tuples for an empty set.

0

1 vote

Answer should be zero.

It is a co-related query. So for every tuple of R, we have to execute a co-related query. Condition S.E>10 is always false, and it is with and condition, so count(*) will return 0, and exist will return false to R each tuple. So 0 record will be selected.

**Answer- 0 Record**