Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 2

In PostgreSQL 18, SELECT NULL::boolean AND false; and SELECT NULL::boolean AND true; are run. What do they return, in that order?

  1. false and false
  2. false and NULLالإجابة الصحيحة
  3. NULL and NULL
  4. NULL and true

الشرح

AND is not symmetric with respect to unknown operands: a single false makes the conjunction false no matter what the other operand is, while an unknown combined with true stays unknown. Answering NULL and NULL treats null as infectious in all cases, which is true for arithmetic but not for the logical operators.

تابع هذا الاختبار

بدء التدريب
السؤال 2: In PostgreSQL 18, SELECT NULL::boolean AND false; and… · SQL: NULL, Joins and Aggregates · Questena