QuestionQ88

VerifiedUsing Conversion Functions and Conditional Expressions

Examine the data in the LIST_PRICE and MIN_PRICE columns of the PRODUCTS table:

Question Image

Which two expressions produce the same output?

Choose two
Explanation

Because LIST_PRICE contains a non-null value in every row, COALESCE(list_price, min_price) always returns LIST_PRICE. Likewise, NVL2(list_price, list_price, min_price) returns LIST_PRICE whenever LIST_PRICE is non-null, and the outer COALESCE leaves those values unchanged. Both expressions therefore return 10000, 20000, and 30000.

Community Discussion

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