Multiple choice technology databases

Command to retrieve today’s date in the format DD/month/YY ?

  1. Select to_date(sysdate,’DD/MONTH/YY’) from dual;

  2. Select to_date(sysdate,’DD/MM/YY’) from dual;

  3. Select to_char(sysdate,’DD/MONTH/YY’) from dual;

  4. Select to_char(sysdate,’DD/MM/YY’) from dual;

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

TO_CHAR converts a date to a string with the specified format. TO_DATE is used to convert a string to a date, which is the opposite of what's needed here. Option C correctly uses TO_CHAR with the format 'DD/MONTH/YY' to display the date with the full month name as the question specifies.