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

In PostgreSQL 18, what does SELECT coalesce(1, 1/0); return?

  1. NULL
  2. It raises a division-by-zero error
  3. 1Ճիշտ պատասխան
  4. 0

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

coalesce is not an ordinary function: like a CASE expression it evaluates only the arguments needed to determine the result, so once the first argument is known to be non-null, 1/0 is never evaluated. Expecting an error assumes the usual rule that all arguments of a function call are evaluated first.

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

Սկսել վարժանքը
Հարց 7: In PostgreSQL 18, what does SELECT coalesce(1, 1/0); return? · SQL: NULL, Joins and Aggregates · Questena