Multiple choice technology databases

Which function return NULL when X = Y and X when it does not?

  1. NULLIF(X,Y)

  2. COALESCE(X,Y)

  3. ZEROIFNULL(X,Y)

  4. NULLIFZERO(X,Y)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The NULLIF(X, Y) function compares two expressions. If they are equal, the function returns NULL. If they are not equal, it returns the first expression (X). COALESCE returns the first non-null value in its list.