Oracle__6. Oracle 1Z0-051 Exam - Date Functions Flashcards
If today is July 9, 2003, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘yyyy/MM/dd’) FROM dual
2003/07/09The TO_CHAR function will have a leading space added when a format model is used for the sign (+/-)
If today is July 9, 2003, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘Month DD, YYYY’) FROM dual
July 09, 2003The TO_CHAR function will have a leading space added when a format model is used for the sign (+/-)
If today is July 9, 2003, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘FMMonth DD, YYYY’) FROM dual
July 9, 2003The FM removes leading zeros
If today is July 9, 2003, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘FMMonth DDth, yyyy’) FROM dual
July 9TH, 2003Notice July is capitalized and TH is all capital letters. The upper and lower case in format strings determines the case of the results.
If today is July 9, 2003, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘FMMON DDth, YYYY’) FROM dual
JUL 9TH, 2003Notice both JUL and TH are all capital letters. The upper and lower case in format strings determines the case of the results.
If today is July 9, 2003, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘FMMon ddth, YYYY’) FROM dual
Jul 9th, 2003Notice July is capitalized and th is all small letters. The upper and lower case in format strings determines the case of the results.
If today is Monday, what is returned from the following statement? SELECT TO_CHAR( sysdate,’DAY’) FROM Dual
MONDAYThe upper and lower case in format strings determines the case of the results.
If today is Monday, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘Day’) FROM Dual
MondayThe upper and lower case in format strings determines the case of the results.
If today is Monday, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘day’) FROM Dual
mondayThe upper and lower case in format strings determines the case of the results.
If it is 1:10 pm, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘HH:mm:ss A.M.’) FROM dual
1:10:00 P.M.Notice periods in PM because there were periods in A.M.
If it is 1:10 pm, what is returned from the following statement? SELECT TO_CHAR( sysdate, ‘HH24:mm:ss AM’) FROM dual
13:10:00 PMNotice no periods in PM because there were no periods in AM
If today is July 4, 2003, what is returned from the following statement? SELECT TO_DATE( ‘2003/07/09’, ‘yyyy/mm/dd’) FROM dual
09-Jul-99 The value returned is a date type and not a string. The default date type format is DD-Mon-RRNote: the data type format of the value must match the format. It does not care what today is.
If today is July 4, 2003, what is returned from the following statement? SELECT TO_CHAR( ‘070903’, ‘mmddyy’) FROM dual
jul0903The upper and lower case in format strings determines the case of the results. It does not care what today is.
What is returned from the following statement? SELECT LAST_DAY( ‘2003/02/03’, ‘yyyy/mm/dd’) FROM dual
28-feb-03 as a date typeThe last day of the month including leap years.The upper and lower case in format strings determines the case of the results.
What is returned from the following statement? SELECT NEXT_DAY( ‘01-AUG-03’, ‘FRIDAY’) FROM dual
returns the date of the next Friday after 1-Aug-03 as a date typeThe day values for the format include SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY, FRIDAY and SATURDAY
If today is FRIDAY, what is returned from the following statement? SELECT NEXT_DAY(sysdate, ‘FRIDAY’) FROM dual
The date value of the next Friday after today.Saturday a week after tomorrow.
What is returned from the following statement? SELECT ADD_MONTHS( ‘07-AUG-03’,3) FROM dual
07-NOV-03 as a date type
What is returned from the following statement? SELECT ADD_MONTHS( ‘05-AUG-03’,-2) FROM dual
05-JUN-03 as a date type
What is returned from the following statement? SELECT MONTHS_BETWEEN( TO_DATE( ‘2003/01/01’, ‘yyyy/mm/dd’), TO_DATE( ‘03-14-2003’, ‘mm-dd-yyyy’)) FROM dual
-2.41934if the same date is used for both parameters the result is 0
What is returned from the following statement? SELECT ROUND( ‘22-AUG-03’, ‘YEAR’) FROM dual
‘01-JAN-04’rounds to the first of the nearest year
What is returned from the following statement? SELECT ROUND( ‘22-AUG-03’, ‘MONTH’) FROM dual
‘01-SEP-03’rounds to the first of the nearest month
What is returned from the following statement? SELECT TRUNC( TO_DATE( ‘22-AUG-03’, ‘YEAR’)) FROM dual
‘01-JAN-03’Truncates to the first day of the year
What is returned from the following statement? SELECT TRUNC( ‘22-AUG-03’, ‘MONTH’) FROM dual
‘01-AUG-03’Truncates to the first day of the month
What is returned from this SQL statement if the value for hire_date is 10-JAN-00? SELECT TO_CHAR(hire_date,’yyyy’) FROM dual
2000 as a character data type