in Databases
253 views
0 votes
0 votes

Consider the following relational schema

in Databases
by
253 views

2 Comments

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.
0
0

1 Answer

1 vote
1 vote

Answer should be 4.

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 .

4 Comments

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 ?
0
0

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)^{'})) $

1
1
Thanks bro
0
0
Thanks brother
0
0