exam questions

Exam 1z0-071 All Questions

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

Exam 1z0-071 topic 1 question 216 discussion

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

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.)

  • A. SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY') - '01-JAN-2019' FROM
  • B. SELECT ROUND(SYSDATE - '01-JAN-2019') FROM DUAL;
  • C. SELECT ROUND(SYSDATE – TO_DATE('01/JANUARY/2019')) FROM DUAL;
  • D. SELECT TO_DATE(SYSDATE, 'DD/MONTH/YYYY') - '01/JANUARY/2019' FROM DUAL;
  • E. SELECT SYSDATE - TO_DATE('01-JANUARY-2019') FROM DUAL;
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️

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
JayaprasanthGurunathan
1 week, 4 days ago
Selected Answer: CE
To calculate the number of days between 1st January 2019 and the current date (SYSDATE) in Oracle SQL, the following considerations apply: SYSDATE is a date data type, so arithmetic operations on dates can directly calculate the difference in days. String literals representing dates (like '01-JAN-2019') must be explicitly converted to date values using TO_DATE. Correct Answers: C. SELECT ROUND(SYSDATE - TO_DATE('01/JANUARY/2019')) FROM DUAL; This query works because TO_DATE('01/JANUARY/2019') converts the string to a date, and subtracting it from SYSDATE gives the number of days. The ROUND function rounds the result to the nearest whole number. E. SELECT SYSDATE - TO_DATE('01-JANUARY-2019') FROM DUAL; This query also works because it correctly converts '01-JANUARY-2019' to a date and subtracts it from SYSDATE, returning the exact number of days as a decimal.
upvoted 1 times
...
HUGO2024
4 months, 2 weeks ago
Selected Answer: CE
C, E is correct
upvoted 1 times
...
Misi_Oracle
7 months, 3 weeks ago
Selected Answer: CE
C is correct if you change the - operator between sysdate and to_date manually. i think there is a mistake.
upvoted 1 times
...
NB196
11 months, 1 week ago
https://www.examtopics.com/discussions/oracle/view/20180-exam-1z0-071-topic-2-question-44-discussion/
upvoted 1 times
...
yaya32
11 months, 3 weeks ago
Selected Answer: E
The only working query is E all of the others are not working.
upvoted 1 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