The INVOICE table has a QTY_SOLD column of data type NUMBER and an INVOICE_DATE column of data type DATE.
NLS_DATE_FORMAT is set to DD-MON-RR.
Which two are true about data type conversions involving these columns in query expressions? (Choose two.)
The INVOICE table has a QTY_SOLD column of data type NUMBER and an INVOICE_DATE column of data type DATE.
NLS_DATE_FORMAT is set to DD-MON-RR.
Which two are true about data type conversions involving these columns in query expressions? (Choose two.)
When considering data type conversions in query expressions, implicit conversions happen automatically without explicit cast functions, whereas explicit conversions require the use of functions like TO_DATE or TO_NUMBER. For the given options, 'invoice_date = '15-march-2019'' uses implicit conversion as Oracle automatically converts the string '15-march-2019' to a DATE type because it matches the DD-MON-RR format. Similarly, 'qty_sold BETWEEN '101' AND '110'' uses implicit conversion since Oracle can implicitly treat string literals '101' and '110' as numbers in the context of a numeric comparison. Therefore, both options A and B involve implicit data type conversions.
AB are correct, I tested it.
ABC are correct
A and C can't work because it doesn't match the NLS date format, D works fine by implicit conversion , so it's BE
E says 'explicit' did you see any conversion function? A works, as MON is for the full month name and RR.. just google it.
why is E wrong?
SELECT CONCAT(sal,hiredate) from emp; try this , it doesn't need explicit conversion
C. invoice_date > '01-02-2019': This statement uses implicit conversion. The date string is implicitly converted to a DATE type using the default date format. D. qty_sold = '0554982': This statement requires explicit conversion. You need to explicitly convert the string to a NUMBER to compare it with the QTY_SOLD column.
Can anyone please explain the correct answers? not quite getting the sense... thank you.
A. Implicit conversion can be done as string matches the NSL_DATE_FORMAT. B. Implicit conversion to number C. Can't use implicit conversion as string doesn't match NSL_DATE_FORMAT D. Doesn't require explicit conversion E. Doesn't require explicit conversion
but the month is spelled out isn't MON the three letter abbreviation of the month?