Test: Quiz: Date Functions
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1
1. What is the result of the following query?
SELECT ADD_MONTHS ('11-JAN-94',6)
FROM dual;
Mark for Review
(1) Points
1/17/2004
1/11/1995
7/11/1994 (*)
7/17/1994
Correct Correct
2. Round and Trunc can be used on Date datatypes. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
3. What function would you use to return the highest date in a month? Mark for Review
(1) Points
FINAL_DAY
END_DAY
HIGHEST_DAY
LAST_DAY (*)
Correct Correct
4. Which query would return a whole number if the sysdate is 26-MAY-04? Mark for Review
(1) Points
SELECT TRUNC(MONTHS_BETWEEN(SYSDATE,'19-MAR-79') /12)
AS YEARS
FROM DUAL;
(*)
SELECT TRUNC(YEARS_BETWEEN(SYSDATE,'19-MAR-79') /12)
AS YEARS
FROM DUAL;
SELECT MONTHS_BETWEEN(SYSDATE,'19-MAR-79') /12
AS YEARS
FROM DUAL;
None of the above
Correct Correct
5. If hire_date has a value of '03-July-03', then what is the output from this code?
SELECT ROUND(hire_date, 'Year') FROM employees;
Mark for Review
(1) Points
01-JAN-04 (*)
01-JAN-03
01-JUL-03
01-AUG-03
Correct Correct
6. What is the result of the following query?
SELECT ADD_YEARS ('11-JAN-94',6)
FROM dual;
Mark for Review
(1) Points
This in not a valid SQL statement. (*)
7/11/1995
1/11/2000
7/11/2000
Correct Correct
( Vrei sa traduci ceva?Want to translate something? http://translate.google.ro/# )
Niciun comentariu:
Trimiteți un comentariu