QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 1

In PostgreSQL 18, what does SELECT 'b' NOT IN ('a', NULL); return?

  1. NULLՃիշտ պատասխան
  2. false
  3. It raises an error
  4. true

Բացատրություն

NOT IN over a value list expands to 'b' <> 'a' AND 'b' <> NULL. The first comparison is true, the second is null, and true AND null is null. The tempting answer true comes from reasoning that 'b' is clearly not 'a', but the unknown comparison cannot be ruled out, and a row filtered by a null predicate is not returned.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 1: In PostgreSQL 18, what does SELECT 'b' NOT IN ('a', NULL);… · SQL: NULL, Joins and Aggregates · Questena