-
In SQL, relations can contain null values, and comparisons with a 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 not (not (x = 5)
- x = 5 x > 4 and x < 6, where x is an integer
- x ≠ 5 not (x = 5)
- None of the above
- x = 5 not (not (x = 5)
Correct Option: C
Option (a) The output of the LHS is 5. In RHS, there are two not operations. Now, when it comes to produce the result, not and not cancels and produce 5.
Option (b) Clearly, LHS and RHS produce the same result 5
Option (c) The output of LHS is the number which is not equal to 5. In RHS, the output will differ in SQL taking the given conditions into considerations.