Oracle Database Administration I — Question 165
18. The orders table has a column ORDER_DATE of data type DATE.
The default display format for a date is DD-MON-RR.
Which two WHERE conditions demonstrate the correct usage of conversion functions? (Choose two.)
Answer options
- A. WHERE order_date > TO_DATE(ADD_MONTHS(SYSDATE, 6), 'MON DD YYYY')
- B. WHERE order dare > TO DATE('JUL 10 2018', 'MON DD YYYY')
- C. WHERE TO_CHAR(order date, 'MON DD YYYY') = 'JAN 20 2019'
- D. WHERE order_date > TO_CHAR(ADD_MONTHS(SYSDATE, 6), 'MON DD YYYY')
- E. WHERE order_date IN (TO_DATE('Oct 21 2018', 'Mon DD YYYY'), TO_CHAR('Nov 21 2018', 'Mon DD YYYY'))
Correct answer: A, C
Explanation
Option A is correct as it properly converts a date to the specified format using TO_DATE. Option C is also correct because it uses TO_CHAR to format the ORDER_DATE for comparison. The other options contain errors such as incorrect function usage or misformatted date strings, making them invalid for this context.