1Z0-061 · Question #296
Examine the data in the LIST_PRICE and MIN_PRICE columns of the PRODUCTS table: Which two expressions give the same output? (Choose two.)
The correct answer is B. NVL(COALESCE(list_price, min_price), 0) D. COALESCE(NVL2(list_price, list_price, min_price), 0). Using the COALESCE Function The advantage of the COALESCE function over the NVL function is that the COALESCE function can take multiple alternate values. If the first expression is not null, the COALESCE function returns that expression; otherwise, it does a COALESCE of the…
Question
Examine the data in the LIST_PRICE and MIN_PRICE columns of the PRODUCTS table:
Which two expressions give the same output? (Choose two.)
Options
- ANVL(NULLIF(list_price, min_price), 0)
- BNVL(COALESCE(list_price, min_price), 0)
- CNVL2(COALESCE(list_price, min_price), min_price, 0)
- DCOALESCE(NVL2(list_price, list_price, min_price), 0)
How the community answered
(19 responses)- A11% (2)
- B74% (14)
- C16% (3)
Explanation
Using the COALESCE Function The advantage of the COALESCE function over the NVL function is that the COALESCE function can take multiple alternate values. If the first expression is not null, the COALESCE function returns that expression; otherwise, it does a COALESCE of the remaining expressions. Using the COALESCE Function The COALESCE function returns the first non-null expression in the list. COALESCE (expr1, expr2, .. exprn) expr1 returns this expression if it is not null expr2 returns this expression if the first expression is null and this expression is not null ?exprn returns this expression if the preceding expressions are null Note that all expressions must be of the same data type.
Topics
Community Discussion
No community discussion yet for this question.