Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 13

In PostgreSQL 18, table emp has 3 rows with dept_id values 10, 20 and NULL, and table dept_null has exactly one row whose id is NULL. How many rows does SELECT * FROM emp e JOIN dept_null d ON d.id = e.dept_id; return?

  1. 0پاسخ درست
  2. 3
  3. 1
  4. 2

توضیح

A pair of rows matches only when the ON expression evaluates to true, and NULL = NULL evaluates to null, so the null dept_id never pairs with the null id. Answering 1 reads the join as matching identical values; writing ON d.id IS NOT DISTINCT FROM e.dept_id is what produces that row.

ادامهٔ این آزمون

شروع تمرین
سؤال 13: In PostgreSQL 18, table emp has 3 rows with dept_id values… · SQL: NULL, Joins and Aggregates · Questena