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

In PostgreSQL 18, what does SELECT count(*), sum(v) FROM m WHERE false; return, given that the WHERE clause removes every row?

  1. One row containing 0 and NULLپاسخ درست
  2. No rows at all
  3. One row containing 0 and 0
  4. One row containing NULL and NULL

توضیح

An aggregate query without GROUP BY always yields exactly one row, and count is the exception that returns 0 over an empty input while the other aggregates return null. Expecting 0 and 0 is the classic cause of a null slipping into a total; coalesce(sum(v), 0) is the usual guard.

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

شروع تمرین
سؤال 17: In PostgreSQL 18, what does SELECT count(*), sum(v) FROM m… · SQL: NULL, Joins and Aggregates · Questena