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

In PostgreSQL 18, SELECT NULL IS DISTINCT FROM NULL, 1 IS DISTINCT FROM NULL; returns two values. Which pair is correct?

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

الشرح

IS DISTINCT FROM is a total comparison that never returns null: two nulls count as not distinct (false), and a null against a non-null counts as distinct (true). This is exactly the pair of cases that the plain <> operator answers with null.

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

بدء التدريب
السؤال 3: In PostgreSQL 18, SELECT NULL IS DISTINCT FROM NULL, 1 IS… · SQL: NULL, Joins and Aggregates · Questena