QuestionQ217

VerifiedUsing Conversion Functions and Conditional Expressions

The ORDERS table contains an ORDER_DATE column whose data type is DATE.

The default date display format is DD-MON-RR.

Which two WHERE conditions demonstrate proper use of conversion functions?

Choose two
Explanation

TO_DATE converts a character literal into a DATE value for comparison with a DATE column, and Oracle's date format-model parser tolerates extra blank spaces unless the FX exact-match modifier is specified, so 'TO_DATE(...,' MON DD YYYY')' parses correctly; separately, TO_CHAR(order_date,'MON DD YYYY') correctly converts the DATE column to a character string so it can be compared to a literal string. These are the two syntactically and semantically correct uses of conversion functions, while the other options misuse ADD_MONTHS (misspelled as ADD_MONTH), apply TO_CHAR to a string literal, or compare a DATE column to a converted string improperly.

Learn more

Community Discussion

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