88 88 votes In SQL, relations can contain null values, and comparisons with null values are treated as unknown. Suppose all comparisons with a null value are treated as false. Which of the following pairs is not equivalent?$x = 5 \quad not (not (x = 5))$$x = 5 \quad x > 4$ and $x < 6,$ where $x$ is an integer$x ≠ 5 \quad not (x = 5)$none of the above Databases gatecse-2000 databases sql normal + – Kathleen 28.7k views answer comment Share Follow Print See all 7 Comments 7 7 Comments reply Show 4 previous comments Chandrabhan Vishwa 1 commented Feb 14, 2024 reply Follow flag in this question = is equivalent to assignment operator and this == is comparision based operator 0 0 replyShare Deepak Poonia commented Jul 22, 2024 i edited by Deepak Poonia Aug 6, 2024 reply Follow flag Detailed Video Solution, with Complete Analysis & Variations: https://youtu.be/zb6vXpZVo1E?t=12&feature=shared (MUST WATCH) 13 13 replyShare Patel_And_Patel commented Dec 19, 2025 reply Follow flag very nice explnation @Deepak Poonia sir 0 0 replyShare Please log in or register to add a comment.
Best answer 91 91 votes Answer is option C. $${\begin{array}{|c|cc|cc|cc|}\hline\\ \textbf{Value at hand}& \textbf{Option A}& & \textbf{Option B}& &\textbf{Option C} \\\hline 6 & \times & \times & \times & \times & \checkmark & \checkmark \\ \hline 5 & \checkmark & \checkmark & \checkmark & \checkmark &\times & \times \\ \hline \text{NULL}& \times & \times & \times & \times &\color{blue} \times & \color{blue}\checkmark \\ \hline \end{array}}$$ amarVashishth answered Dec 23, 2015 • edited Apr 15, 2019 by ajaysoni1924 amarVashishth comment Share Follow See all 13 Comments 13 13 Comments reply Aayushi Aggarwal commented Sep 11, 2016 reply Follow flag @amarVashishth can oyu please explain me the options given, Like i am not able relate between null and x=5. Where does comparision with null comes in picture? 0 0 replyShare vijaycs commented Sep 11, 2016 reply Follow flag @Aayushi, I am trying to explain option c. Suppose all comparisons with a null value are treated as false. now see, LHS = x !=5, lets take x=null, => (null) !=5 => false. RHS = not( x = 5) , => not ( null = 5) =>> not (false) =>> true. Now check above solution for other options.. 73 73 replyShare iita commented Jan 14, 2017 reply Follow flag Can u explain about all options and their correctness, means how are they correct 0 0 replyShare Cristine commented Dec 10, 2018 reply Follow flag Suppose x=NULL a) NULL=5 is false ; Not(Not(NULL=5) => Not(Not(False)) => Not(true) => false...so they are equivalent. b) NULL=6 is false ; NULL> 4 and NULL<6 is also false so they are also equivalent. 1 1 replyShare Doraemon commented Apr 8, 2020 reply Follow flag Just to add a point: Comparison with NULL value are in general unknown. But here we are treating it to be false. 4 4 replyShare mani312 commented Jan 26, 2021 reply Follow flag Does anyone observe this statement comparisons with null values are treated as unknown. And how you are concluding NULL != 5 as False. 1 1 replyShare Pranavpurkar commented Oct 31, 2021 reply Follow flag vijaycs why are we taking here x=NULL? 1 1 replyShare Rusty_01 commented Oct 29, 2022 reply Follow flag We’re taking x as a numeric attribute here and which can also be null. I think. 0 0 replyShare Priyanshu Karmakar commented Nov 4, 2022 reply Follow flag @mani312 that's generally the case. But in the given question it is said to consider a two logic system by considering comparison with null is false. 1 1 replyShare Deepak Poonia commented Jul 22, 2024 i edited by Deepak Poonia Aug 6, 2024 reply Follow flag Detailed Video Solution, with Complete Analysis & Variations: https://youtu.be/zb6vXpZVo1E?t=12&feature=shared (MUST WATCH) 1 1 replyShare SravaniNaidu commented Sep 2, 2024 reply Follow flag Nice question with good explanation, thank you sir 1 1 replyShare Sandip_Pal commented Sep 21, 2024 reply Follow flag Sir nice question with very good explanation tahnk you sir 0 0 replyShare jenilS7 commented Dec 12, 2024 reply Follow flag Not(unknown) should be unknown Right? 1 1 replyShare Please log in or register to add a comment.
46 46 votes Answer: C As (null) != 5 gives false. But, not((null) = 5) gives not(false) gives true. Aravind answered Sep 25, 2014 • edited May 19, 2015 by Rajarshi Sarkar Aravind comment Share Follow See all 3 Comments 3 3 Comments reply Rupjit Chakraborty commented Oct 11, 2014 reply Follow flag option (b) NULL=5 False x>4 and x<6 where x is an integer Please explain how this evaluates to false 0 0 replyShare Aravind commented Oct 13, 2014 reply Follow flag in all the options, will be evaluating the pair of equations with same value of x(whether it is null or an integer) in option 'b' x is always an integer, so whatever value of x u put both x=5 and x>4 and x<6 will always give the same answer 6 6 replyShare Rupjit Chakraborty commented Nov 6, 2014 reply Follow flag Yes. THANKS 0 0 replyShare Please log in or register to add a comment.
42 42 votes a.null = 5 => false , not(not(null=5)) = not(not(false)) = not(true) = false b. null = 5 => false , null>4 and null <6 = False and false = false c.null ≠ 5 => false not(null= 5)= not (false) = true ∴ option C is not eqivivalent heena singh answered Nov 29, 2017 heena singh comment Share Follow 0 reply Please log in or register to add a comment.
2 2 votes According to given question, comparison with NULL value always False, so “x ≠ 5” will be false. “x = 5” will also false and not (x = 5) = not(false) = true. Hence, these are not equivalent pair. ans-C Shailendra_ answered Nov 10, 2019 Shailendra_ comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote SQL definition= Comparison with null value = UnknownGiven in Question = Comparison with null value = False Take x= Null in every option a- Null=5, not(not(x=5)) False not(not(False)) ---------> True Not(true) Falseb- Null=5 null>4 and null<6 ---------> True False False C- Null/=5 not(null=5) False not(false) ---------> Flase True akshay_123 answered Aug 22, 2025 akshay_123 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes https://youtu.be/zb6vXpZVo1E?t=12&feature=shared TirthNandha answered Dec 9, 2024 TirthNandha comment Share Follow 0 reply Please log in or register to add a comment.