64 votes 64 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 asked Sep 14, 2014 • edited Oct 26, 2016 by go_editor Kathleen 18.8k views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments Abhineet Singh commented Nov 24, 2020 reply Follow Share finally I have understood this question !!! 1 votes 1 votes GovindYadav29 commented Dec 24, 2022 reply Follow Share We can take any value and compare this each expression given in option . 0 votes 0 votes Chandrabhan Vishwa 1 commented Feb 14 reply Follow Share in this question = is equivalent to assignment operator and this == is comparision based operator 0 votes 0 votes Please log in or register to add a comment.
Best answer 76 votes 76 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 9 Comments See all 9 9 Comments reply Show 6 previous comments Pranavpurkar commented Oct 31, 2021 reply Follow Share vijaycs why are we taking here x=NULL? 1 votes 1 votes Rusty_01 commented Oct 29, 2022 reply Follow Share We’re taking x as a numeric attribute here and which can also be null. I think. 0 votes 0 votes Priyanshu Karmakar commented Nov 4, 2022 reply Follow Share @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 votes 1 votes Please log in or register to add a comment.
35 votes 35 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 See all 3 3 Comments reply Rupjit Chakraborty commented Oct 11, 2014 reply Follow Share option (b) NULL=5 False x>4 and x<6 where x is an integer Please explain how this evaluates to false 0 votes 0 votes Aravind commented Oct 13, 2014 reply Follow Share 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 5 votes 5 votes Rupjit Chakraborty commented Nov 6, 2014 reply Follow Share Yes. THANKS 0 votes 0 votes Please log in or register to add a comment.
33 votes 33 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 See all 0 reply Please log in or register to add a comment.
1 votes 1 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 See all 0 reply Please log in or register to add a comment.