edited by
28,435 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

0 0 votes
there are three cases included for checking every answer so we firstly we take equals to to the x =5 and secong like another value not x != 5 and then take null value so when we check this null condition on both of lhs and rhs then in rhs it gets T but lhs side its F so this is not equals here so the answer c is correct

]
0 0 votes

Answer: C

Because when x is NULL (and comparisons with NULL are treated as false as given in question):

  • x ≠ 5false ( bcz comparision with null is false )

  • x = 5 → false → not(x = 5)true

So they differ when x is NULL.

Hence, Option C is not equivalent.

0 0 votes
Answer: C

Given: Any comparison involving NULL is treated as FALSE.

Consider option C:

x ≠ 5        vs        NOT(x = 5)

If x = NULL:
x ≠ 5  → FALSE

x = 5  → FALSE
NOT(x = 5) → NOT(FALSE) → TRUE

Thus,

x ≠ 5 ≠ NOT(x = 5)

So, these two expressions are NOT equivalent.

Check other options:
- A: x = 5 and NOT(NOT(x = 5)) are equivalent.
- B: For integer x, x = 5 and (x > 4 AND x < 6) are equivalent. For NULL, both evaluate to FALSE.

Therefore, the correct answer is:

C. x ≠ 5 and NOT(x = 5)
ago
Answer:
Position:
Show:

Related questions

51 51 votes
8 answers 8 answers
17.3k
17.3k views
Kathleen asked Sep 14, 2014
17,280 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,360 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,395 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,215 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, ...