253 views

Consider the following relational schema

Should be 0.

Inner query/subquery returns 0 records(or an empty table). This means C=ALL is like C=NULL and we can't compare with a null value as well as there is no value in C matching this.

I am doubtful about what C is compared with in C=ALL after the inner query has been evaluated.

## All clouse is alwys gives true when inner querey is null .so "select * " statement select  all row in the relation R. And total number of row is 4 .

Sir in all query we extend the condition and connect it with and so i don't understand why does it prints everything if nothing is returned ?

What happens in the case of Any or Some if null is returned in inner relation ?

In case of ANY ,conditions evaluates to False if inner query returns 0.

In case of ALL ,conditions evaluates to Tue if inner query returns 0.

Reason-:

Any is analogous to -$\text{there exists anyone for which it is true.}\equiv (\exists P(x)),P(x) \text{is any condition for any x}$

In order to return inner query $0$,the expression must be $¬(\exists x P(x))=\forall x P(x)^{'}$

i.e there is none for which $P(x)$ is true.

ALL is analogous to $\forall x P(x) \equiv ¬ (\exists x P(x)^{'})$

In order to return inner query $0$,the expression must be $¬(¬(\exists x P(x)^{'}))$

Thanks bro
Thanks brother

1 vote