nerdexam
Oracle

1Z0-007 · Question #176

You would like to display the system date in the format "Monday, 01 June, 2001". Which SELECT statement should you use?

The correct answer is C. SELECT TO_CHAR(SYSDATE, 'FMDay, DD Month, YYYY') FROM dual;. This answer is correct: "Day" shows the day spelled out, "DD" shows the two-digit date, "Month" provides the month spelled out, "YYYY" shows the four-digit year. "FMDay" is special format mask to suppresses the extra spaces between the name of the day and the number of the date.

Using Functions (Single-Row, Group, Conversion, Conditional)

Question

You would like to display the system date in the format "Monday, 01 June, 2001". Which SELECT statement should you use?

Options

  • ASELECT TO_DATE(SYSDATE, 'FMDAY, DD Month, YYYY') FROM dual;
  • BSELECT TO_CHAR(SYSDATE, 'FMDD, DY Month, 'YYYY') FROM dual;
  • CSELECT TO_CHAR(SYSDATE, 'FMDay, DD Month, YYYY') FROM dual;
  • DSELECT TO_CHAR(SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual;
  • ESELECT TO_DATE(SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual;

How the community answered

(29 responses)
  • A
    7% (2)
  • C
    76% (22)
  • D
    3% (1)
  • E
    14% (4)

Explanation

This answer is correct: "Day" shows the day spelled out, "DD" shows the two-digit date, "Month" provides the month spelled out, "YYYY" shows the four-digit year. "FMDay" is special format mask to suppresses the extra spaces between the name of the day and the number of the date. Incorrect Answers A: This statement will return an error because of inappropriate usage of the TO_DATE() function. B: Incorrect format mask "DY" is used to show the number of the day. D: Incorrect format mask "DY" is used to show the name of the day and format mask "DDD" is used to show the number of the day. E: Incorrect format mask "DY" is used to show the name of the day and format mask "DDD" is used to show the number of the day. Also this statement will return an error because of inappropriate usage of the TO_DATE() function.

Topics

#TO_CHAR#date format model#SYSDATE#format masks

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice