QuestionQ164

VerifiedUsing Conversion Functions and Conditional Expressions

The PRODUCTS table has the following structure:

Question Image

Evaluate these two SQL statements:

Question Image

Which statement about the outcome is true?

Explanation

NVL2 returns its second expression when PROD_EXPIRY_DATE is not null and its third expression when it is null. Because its third expression is an empty character literal, the date calculation is converted to character data. NVL returns a DATE here because both expressions are DATE-compatible; moreover, adding 15 to a null date still produces null. Therefore, both statements execute but return different results.

Community Discussion

No comments yet. Be the first to start the discussion!