1 votes 1 votes what will be the output(how many tupples) Databases databases sql + – gari asked Jan 18, 2018 gari 1.3k views answer comment Share Follow See all 12 Comments See all 12 12 Comments reply joshi_nitish commented Jan 18, 2018 reply Follow Share it will return $4$ tupples, empty table is trivially true for ALL keyword. 1 votes 1 votes gari commented Jan 18, 2018 reply Follow Share ans is 4 but i tried on this https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_any&ss=-1 using query SELECT * FROM OrderDetails WHERE OrderID = ALL (SELECT ProductID FROM OrderDetails WHERE Quantity = 100); and result was 0 tuples. @joshi_nitish please explain. 0 votes 0 votes joshi_nitish commented Jan 18, 2018 reply Follow Share @gari, there you don't know about the content of table(OrderDetails), what if actually there is some ProductId for a Quantity=10, then your inner query will not return empty, and hence there are chances for =ALL to become false. try for some large like 100000000000000, then you will see that =ALL will return true. 0 votes 0 votes gari commented Jan 18, 2018 reply Follow Share on the right side i saw the tables(data).(UNDER your database ).. and chose the oder details as 100 .. it was not in table..... 0 votes 0 votes gari commented Jan 18, 2018 reply Follow Share so sorry .. 100 is there in the table....you are correct the answer is 4. thanks @ joshi_nitish 0 votes 0 votes gari commented Jan 18, 2018 reply Follow Share ALL ,ANY ,SOME are trivially true for any comparison on an empty table? 0 votes 0 votes Akshay Koli 4 commented Jan 18, 2018 reply Follow Share yes it is 4. The >=,=.. ALL test is vacuously true with an empty subquery. 0 votes 0 votes joshi_nitish commented Jan 18, 2018 reply Follow Share @gari, only ALL is trivially true for empty relation, ANY/SUM are not. 0 votes 0 votes Ashwin Kulkarni commented Jan 18, 2018 reply Follow Share ANY/SOME :p 1 votes 1 votes joshi_nitish commented Jan 18, 2018 reply Follow Share bhavnae samjho, sabdo me kya rakha hai :P 2 votes 2 votes Chirag arora commented Jan 18, 2018 reply Follow Share How it is 4 , as value of C should be equal to all the values of subquery , m not getting 0 votes 0 votes Kiran Karwa commented Jan 18, 2018 reply Follow Share @nitish =ALL will always return false right if that subquery returns two/more distinct values? and had this been asked as =ANY then it will return 0 ? 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes 0 tuples will be selected. Avik Chowdhury answered Mar 19, 2018 Avik Chowdhury comment Share Follow See all 2 Comments See all 2 2 Comments reply abhishekmehta4u commented Mar 19, 2018 reply Follow Share 4 tuples are selected. Becz all clause is true in case empty set 1 votes 1 votes akshat sharma commented Mar 20, 2018 reply Follow Share yes in case of ALL if every tuple is giving false answer then it will return all rows of table ike in above case 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes All will be returned Psy Duck answered Oct 30, 2022 Psy Duck comment Share Follow See all 0 reply Please log in or register to add a comment.