exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 140 discussion

Actual exam question from Oracle's 1z0-071
Question #: 140
Topic #: 1
[All 1z0-071 Questions]

In your session NLS_DATE_FORMAT is set to DD-MON-RR.

Which two queries display the year as four digits? (Choose two.)

  • A. SELECT TO_DATE(SYSDATE, 'RRRR-MM-DD') FROM DUAL;
  • B. SELECT TO_CHAR(SYSDATE, MM/DD/YYYY) FROM DUAL;
  • C. SELECT TO_DATE(ADD_MONTHS(SYSDATE, 6), 'dd-non-yyyy') FROM DUAL;
  • D. SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 6)) FROM DUAL;
  • E. SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 6), 'dd-mon-yyyy') FROM DUAL;
  • F. SELECT TO_DATE(TO_CHAR(SYSDATE, 'MM/DD/YYYY'), 'MM/DD/YYYY') FROM DUAL;
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Thameur01
6 days, 11 hours ago
Selected Answer: EF
E and F are the correct answers: tested and confirmed: SELECT TO_DATE(TO_CHAR(SYSDATE, 'MM/DD/YYYY'), 'MM/DD/YYYY') FROM DUAL; SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 6), 'dd-mon-yyyy') FROM DUAL;
upvoted 1 times
...
salander71
3 months, 1 week ago
B is not correct, because the date format 'MM/DD/YYYY' should be enclosed in single quotes, otherwise it's a syntax error.
upvoted 2 times
...
ShahedOdeh
3 months, 3 weeks ago
B and E tested
upvoted 1 times
...
ArslanAltaf
7 months, 1 week ago
E & B will show year forma in 4 digits only if you consider B has no typing error..the string has to be quoted. SELECT TO_CHAR(SYSDATE, 'MM/DD/YYYY') FROM DUAL; In answer it is written MM/DD/YYYY without quotes.
upvoted 1 times
...
ogi33
9 months, 1 week ago
D have no fm so best is E F
upvoted 1 times
...
hmatinnn
10 months, 3 weeks ago
Selected Answer: EF
Why F is not correct in my editor it gives a result ? I think the answer is (BEF)
upvoted 1 times
...
deepzsiva
12 months ago
Selected Answer: BE
B & E is correct answer. Tested.
upvoted 1 times
...
lucemqy
1 year, 1 month ago
Selected Answer: BE
BE is correct
upvoted 1 times
...
jm9999
1 year, 3 months ago
Selected Answer: BE
Just need quotes around format string in B
upvoted 2 times
...
zouve
1 year, 6 months ago
B only if you correct it SELECT TO_CHAR(SYSDATE, 'MM/DD/YYYY') FROM DUAL; and E
upvoted 1 times
...
Cecilia_Soso
1 year, 8 months ago
B and e
upvoted 1 times
...
MooonLight
1 year, 8 months ago
sorry i am kind of confused...why do they have to be converted to character?
upvoted 1 times
...
Rik92
1 year, 10 months ago
Weird. Imported all in to Oracle apex and got the following results: SELECT TO_DATE(SYSDATE, 'RRRR-MM-DD') FROM DUAL; ---- ORA-01843: not a valid month SELECT TO_CHAR(SYSDATE, MM/DD/YYYY) FROM DUAL; ----- Error at line 1/31: ORA-00904: "YYYY": invalid identifier. This answer is missing single quotes around the format, otherwise it would be correct. SELECT TO_DATE(ADD_MONTHS(SYSDATE, 6), 'dd-mon-yyyy') FROM DUAL; ------ ORA-01843: not a valid month SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 6)) FROM DUAL; ------ 09/15/2023 and thus is correct. SELECT TO_CHAR(ADD_MONTHS(SYSDATE, 6), 'dd-mon-yyyy') FROM DUAL; ------ 15-sep-2023 and thus is also correct. SELECT TO_DATE(TO_CHAR(SYSDATE, 'MM/DD/YYYY'), 'MM/DD/YYYY') FROM DUAL; ------- 03/15/2023 and thus is also correct?| This question is just a mess...
upvoted 1 times
ogi33
9 months, 1 week ago
D have no fm so best is E F
upvoted 1 times
...
yanoolthecool
1 year ago
Im guessing there's a typo in B, u probably missed: "In your session NLS_DATE_FORMAT is set to DD-MON-RR."
upvoted 2 times
...
...
kesammy9
1 year, 10 months ago
Selected Answer: BE
BE is correct
upvoted 1 times
...
jfc1
1 year, 11 months ago
Selected Answer: BE
BE is correct
upvoted 3 times
...
cadcadley
2 years ago
BE is correct
upvoted 3 times
...
Babi265
2 years, 1 month ago
Checked it should be B and E
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago