0 votes 0 votes Niharika 1 asked Nov 20, 2017 Niharika 1 716 views answer comment Share Follow See all 10 Comments See all 10 10 Comments reply Akash Mittal commented Nov 20, 2017 i moved by Akash Mittal Nov 20, 2017 reply Follow Share is it c? 0 votes 0 votes Prabhanjan_1 commented Nov 20, 2017 reply Follow Share It will return $\color{red} {0}$ rows. Here select B from Mystery is causing problem as it contains $\color{blue} {NULL}$ Values Not in (null,....) => returns $\color{red} {0}$ rows 1 votes 1 votes akash.dinkar12 commented Nov 20, 2017 reply Follow Share it will return 0, it means 1 row will be printed!!! 0 votes 0 votes srestha commented Nov 20, 2017 reply Follow Share what not in will return? value of A!= value of B right 0 votes 0 votes akash.dinkar12 commented Nov 20, 2017 reply Follow Share IN clause work like checking set membership. Select B from mystery will return 4 rows(NULL,4,5,6) when we compare a value of A attribute with above output it will not match with anyone and remember two Nulls are always different. So, there will be no data to print.So 0 rows will be shown by using count(*) 3 votes 3 votes Niharika 1 commented Nov 20, 2017 reply Follow Share B answer zero 0 votes 0 votes just_bhavana commented Nov 20, 2017 reply Follow Share had there been some other value in place of NULL in B (except for 1, 2 and 3) what would be returned ? 0 votes 0 votes joshi_nitish commented Nov 20, 2017 reply Follow Share then count(*) would return 3 1 votes 1 votes Hemant Parihar commented Nov 20, 2017 reply Follow Share @akash.dinkar12 Please see my comment below the answer, Can you explain why the output is 3? As you said Null comparison with Null is considered as different. 0 votes 0 votes akash.dinkar12 commented Nov 20, 2017 reply Follow Share see this... 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes its C Akash Mittal answered Nov 20, 2017 Akash Mittal comment Share Follow See all 3 Comments See all 3 3 Comments reply Hemant Parihar commented Nov 20, 2017 reply Follow Share You did a typo while inserting into the table see this. 0 votes 0 votes joshi_nitish commented Nov 20, 2017 reply Follow Share @Hemant in your's SQL engine is ANSII NULL is set off ? because, then only it will give 3. 1 votes 1 votes Hemant Parihar commented Nov 20, 2017 reply Follow Share @joshi Don't know. There is no such option. 0 votes 0 votes Please log in or register to add a comment.