QuestionQ186

VerifiedUsing Conversion Functions and Conditional Expressions

Refer to the exhibit and review the structure of the PROMOTIONS table.

Exhibit:

Question Image

Which two SQL statements execute successfully?

Choose two
Explanation

PROMO_COST is a NUMBER, so it can be increased by 100. PROMO_END_DATE and PROMO_BEGIN_DATE are DATE columns, and TO_CHAR validly converts them using the supplied datetime format models. The YYYY conversion produces a character year for comparison with '2000'; the lowercase mon dd yy model produces a lowercase abbreviated month, matching 'jul 01 98'. TO_DATE calls that omit a format model depend on the session's default NLS_DATE_FORMAT; the character inputs in the other statements do not conform to the expected default format. Oracle documents that an omitted TO_DATE format model requires the input to match the default date format.

Learn more

Community Discussion

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