🎴 Flashcard Mode

Database Management and SQL Functions

Card1 / 19
Mastered0
Review0
QuestionClick to flip

What output will the follwing statement produce? Select NVL2(NULL,'NOT NULL', NULL) from dual?

AnswerClick to flip back
A
NULL
💡 Explanation:

To solve this question, the user needs to know the function NVL2 in SQL.

The NVL2 function in SQL returns one value if an expression is not null, or another value if it is null. The syntax for the NVL2 function is:

NVL2( expression1, expression2, expression3 )

If expression1 is not null, then NVL2 returns expression2. If expression1 is null, then NVL2 returns expression3.

In this case, expression1 is NULL, so NVL2 will return the value of expression3, which is also NULL.

Therefore, the answer is:

The Answer is: A. NULL

Change Mode