1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 207


You need to calculate the number of days from 1st January 2019 until today.

Dates are stored in the default format of DD-MON-RR.

Which two queries give the required output? (Choose two.)

Show Answer
Correct Answer: BCE

To calculate the number of days between SYSDATE and a specific date in Oracle SQL, you need to use the correct date format and functions. Option B is correct since SYSDATE is already a date type, and subtracting a date string from it properly in the format 'DD-MON-YYYY' will give the number of days. However, it needs to be enclosed in parentheses and 'DUAL' table is required for execution. Option E is also correct as it correctly transforms the string date '01-JANUARY-2019' into a date using TO_DATE function and then subtracts it from SYSDATE to return the number of days.

Discussion

3 comments
Sign in to comment
yaya32Option: E
Jan 24, 2024

The only working query is E all of the others are not working.

NB196
Feb 7, 2024

https://www.examtopics.com/discussions/oracle/view/20180-exam-1z0-071-topic-2-question-44-discussion/

Misi_OracleOptions: CE
May 24, 2024

C is correct if you change the - operator between sysdate and to_date manually. i think there is a mistake.