edited by
28,399 views
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?

  1. $x = 5 \quad not (not (x = 5))$
  2. $x = 5 \quad x > 4$ and $x < 6,$ where $x$ is an integer
  3. $x ≠ 5 \quad not (x = 5)$
  4. none of the above

9 Answers

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}}$$

edited by
45 45 votes
Answer: C

As (null) != 5 gives false.
But, not((null) = 5) gives not(false) gives true.
edited by
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
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

1 1 vote

SQL definition= Comparison with null value = Unknown

Given 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)

                           False

b-      Null=5                     null>4 and null<6                      --------->       True

  False                             False        

 

C-    Null/=5                        not(null=5)

          False                            not(false)            --------->       Flase

                                                  True

Answer:
Position:
Show:

Related questions

51 51 votes
8 answers 8 answers
17.2k
17.2k views
Kathleen asked Sep 14, 2014
17,235 views
A multiset is an unordered collection of elements where elements may repeat any number of times. The size of a multiset is the number of elements in it, counting repetiti...
13 13 votes
2 2 answers
4.4k
4.4k views
Kathleen asked Sep 14, 2014
4,354 views
Consider a bank database with only one relation transaction (transno, acctno, date, amount)The amount attribute value is positive for deposits and negative for withdrawa...
81 81 votes
5 answers 5 answers
25.4k
25.4k views
Kathleen asked Sep 14, 2014
25,360 views
Given relations r(w, x) and s(y, z) the result ofselect distinct w, x from r, s is guaranteed to be same as r, provided.r has no duplicates and s is non-emptyr and s have...
20 20 votes
2 2 answers
7.2k
7.2k views
Kathleen asked Sep 14, 2014
7,209 views
(a) Suppose you are given an empty $B^+$ tree where each node (leaf and internal) can store up to $5$ key values. Suppose values $1, 2,\ldots 10$ are inserted, in order, ...