FUNDAMENTALS OF COMPUTER

DATABASE FUNDAMENTALS

DATA WAREHOUSING AND DATA MINING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which one of the following is the right syntax for DECODE?
A
DECODE (search, expression, result [, search, result] ____ [, default])
B
DECODE (expression, result [, search, result] ____ [, default], search)
C
DECODE (search, result [, search, result] ____ [, default], expression)
D
DECODE (expression, search, result [, search, result] ____ [, default])
Explanation: 

Detailed explanation-1: -DECODE compares the expression to each search value one by one. If expression is equal to a search, then the corresponding result is returned by the Oracle Database. If a match is not found, then default is returned. If default is omitted, then Oracle returns null.

Detailed explanation-2: -The DECODE function compares each expression2 to expression1. If expression1 is equal to expression2, or both expression1 and expression2 are null, the value of the result-expression is returned. If no expression2 matches expression1, the value of else-expression is returned. Otherwise a null value is returned.

Detailed explanation-3: -The DECODE function does equality comparisons between arguments, also treating null values as equal, to determine which argument to return as the result. The schema is SYSIBM. The DECODE function compares each expression2 to expression1 .

There is 1 question to complete.