nerdexam
Oracle

1Z0-061 · Question #161

See the Exhibit and examine the structure of the PROMOSTIONS table: Which SQL statements are valid? (Choose all that apply.)

The correct answer is A. SELECT promo_id, DECODE(NVL(promo_cost, 0), promo_cost, B. SELECT promo_id, DECODE(promo_cost, 10000. The DECODE Function Although its name sounds mysterious, this function is straightforward. The DECODE function implements ifthen-else conditional logic by testing its first two terms for equality and returns the third if they are equal and optionally returns another term if…

Using Conversion Functions and Conditional Expressions

Question

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

Which SQL statements are valid? (Choose all that apply.)

Exhibit

1Z0-061 question #161 exhibit

Options

  • ASELECT promo_id, DECODE(NVL(promo_cost, 0), promo_cost,
  • BSELECT promo_id, DECODE(promo_cost, 10000,
  • CSELECT promo_id, DECODE(NULLIF(promo_cost, 10000),
  • DSELECT promo_id, DECODE(promo_cost, >10000, 'High',

How the community answered

(29 responses)
  • A
    86% (25)
  • C
    10% (3)
  • D
    3% (1)

Explanation

The DECODE Function Although its name sounds mysterious, this function is straightforward. The DECODE function implements ifthen-else conditional logic by testing its first two terms for equality and returns the third if they are equal and optionally returns another term if they are not. The DECODE function takes at least three mandatory parameters, but can take many more. The syntax of the function is DECODE(expr1, comp1, iftrue1, [comp2, iftrue2...[ compN, iftrueN]], [iffalse]).

Topics

#DECODE#NVL#NULLIF#conditional expressions

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice