Oracle Database Administration I — Question 89
Which two queries execute successfully? (Choose two.)
Answer options
- A. SELECT NULLIF(NULL, 100) FROM DUAL;
- B. SELECT NULLIF(100, 'A') FROM DUAL;
- C. SELECT COALESCE(100, 'A') FROM DUAL;
- D. SELECT COALESCE(100, NULL, 200) FROM DUAL;
- E. SELECT NULLIF(100, 100) FROM DUAL;
Correct answer: D, E
Explanation
Option D executes successfully because COALESCE can handle NULL values and will return the first non-null value, which is 100. Option E also executes successfully because NULLIF returns NULL if the two arguments are equal, and since both are 100, it returns NULL. Options A, B, and C will fail due to incompatible data types or logic.