0 votes 0 votes Consider the following relational schema Databases sql databases + – Na462 asked May 12, 2018 Na462 419 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Akhilesh Singla commented May 12, 2018 reply Follow Share 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 votes 0 votes Kajal Khobragade commented Jun 27, 2018 reply Follow Share https://www.w3resource.com/sql/special-operators/sql_all.php https://oracle-base.com/articles/misc/all-any-some-comparison-conditions-in-sql 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes 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 . abhishekmehta4u answered May 12, 2018 abhishekmehta4u comment Share Follow See all 4 Comments See all 4 4 Comments reply Na462 commented May 12, 2018 reply Follow Share 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 votes 0 votes Anand. commented Jun 27, 2018 reply Follow Share 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 votes 1 votes Na462 commented Jun 27, 2018 reply Follow Share Thanks bro 0 votes 0 votes Na462 commented Jun 27, 2018 reply Follow Share Thanks brother 0 votes 0 votes Please log in or register to add a comment.