st You need to calculate the number of days from 1 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 DUAL;
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;
A - false; query <SELECT TO_CHAR(sysdate,'DD-MON-YYYY') - '01-JAN-2019' FROM dual;> returns ORA-01722: invalid number
B - false; query <SELECT ROUND(sysdate - '01-JAN-2019') FROM dual;> returns ORA-01722: invalid number
C - true; query <SELECT ROUND(sysdate - TO_DATE('01/JANUARY/2019')) FROM dual;> returns number of days as natural number
D - false; query <SELECT TO_DATE(sysdate,'DD/MONTN/YYYY') - '01/JANUARY/2019' FROM dual;> returns ORA-01821: date format not recognized
E - true; query <SELECT sysdate - TO_DATE('01/JANUARY/2019') FROM dual;> returns number of days as floating number
The Options should be:
A. SELECT TO_CHAR (SYSDATE, ‘DD-MON-YYYY’) – ’01-JAN-2019’ FROM DUAL;
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;
C and E are correct
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.
nautil2
2 months, 2 weeks agoOracle2020
4 months, 2 weeks agomusafir
5 months, 3 weeks agoRaNik69
8 months, 3 weeks ago[Removed]
1 year, 4 months ago