Which two queries execute successfully?
The NULLIF and COALESCE functions in Oracle SQL serve specific purposes:
Option A: Executes successfully. NULLIF returns NULL if the two arguments are equal; otherwise, it returns the first argument.
Option B: Also correct. COALESCE returns the first non-null value among its arguments.
Option C: This will not execute successfully because NULLIF requires both arguments to be of comparable data types. Comparing an integer to a character ('100' to 'A') is invalid.
Option D: Executes successfully. NULLIF returns NULL because it compares NULL to a number, which is valid (though always yields NULL).
Option E: Executes successfully. COALESCE accepts any data type as it returns the first non-null value, irrespective of type consistency among the arguments.
Currently there are no comments in this discussion, be the first to comment!