To calculate the number of days from 1st Jan 2007 till date: Dates are stored in the default format of dd-mm-rr. Which SQL statements would give the required output? Select one or more: SELECT SYSDATE - '01-JAN-2007' FROM DUAL ; SELECT TO_DATE(SYSDATE,'DD/MONTH/YYYY')-'01/JANUARY/2007' FROM DUAL; SELECT SYSDATE - TO_DATE('01-JANUARY-2007) FROM DUAL; SELECT TO_CHAR(SYSDATE,'DD-MON-YYYY')-'01-JAN-2007' FROM DUAL; SELECT SYSDATE - TO_DATE('01/JANUARY/2007') FROM DUAL;
Answers
Answer:
SELECT SYSDATE - TO_DATE('01/JANUARY/2007') FROM DUAL;
SELECT SYSDATE - TO_DATE('01-JANUARY-2007) FROM DUAL;
Explanation:
Answer:
C. SELECT SYSDATE - TO_DATE(’01-JANUARY-2007′) FROM DUAL;
E. SELECT SYSDATE - TO_DATE(’01/JANUARY/2007") FROM DUAL;
Explanation:
DUAL is special one row, one column table created by Oracle Database along with the data dictionary. It comes under the user SYS but is accessible by the name DUAL to all users. DUAL has a single VARCHAR2(1) column known as DUMMY which contains a value of 'X'. MySQL allows it to be specified as a table in queries that does not need data from any tables. In SQL Server DUAL table does not exist, but we can create one.
SYSDATE() function in SQL returns the current system date and time.
The date and time is returned in the format "YYYY-MM-DD HH:MM:SS" which is a string or as YYYYMMDDHHMMSS in numeric form.
Hence the correct options are:
C. SELECT SYSDATE - TO_DATE(’01-JANUARY-2007′) FROM DUAL;
E. SELECT SYSDATE - TO_DATE(’01/JANUARY/2007") FROM DUAL;
#SPJ3
To know more about SQL commands, click here:
https://brainly.in/question/10960681?msp_srt_exp=4
https://brainly.in/question/12873757