QuestionQ234

VerifiedUsing Conversion Functions and Conditional Expressions

See the Exhibit and examine the structure of the PROMOSTIONS table:

Question Image

Which SQL statements are valid?

Choose two
Explanation

DECODE compares an expression with discrete search values. Statements A and B use compatible numeric search and return expressions. A DECODE whose first result is numeric returns a numeric type; therefore, C cannot return the nonnumeric default value 'N/A' as a numeric result. Range predicates such as greater-than and less-than are not valid DECODE search values, so D requires a CASE expression instead.

Learn more

Community Discussion

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