The PRODUCTS table has the following structure:
Evaluate the following two SQL statements:
Which statement is true regarding the outcome?
A.
Both the statements execute and give the same result
B.
Both the statements execute and give different results
C.
Only the second SQL statement executes successfully
D.
Only the first SQL statement executes successfully
Explanation:
Using the NVL2 Function
The NVL2 function examines the first expression. If the first expression is not null, the NVL2
function returns the second expression. If the first expression is null, the third expression is
returned.
Syntax
NVL2(expr1, expr2, expr3)
In the syntax:
expr1 is the source value or expression that may contain a null
expr2 is the value that is returned if expr1 is not null
expr3 is the value that is returned if expr1 is null
‘B’ is only The correct answer.
i think answer B is wrong cause the two exp2 and exp3 are different and the rule of NVL2 is both expression should have the same data type
I think the third expression in the first statement is omitted and thats why we have the ” sign and a comma after the second expression.