Multiple choice technology databases

What is the correct use of the Trunc command on a date?

  1. TRUNC=To_Date('09-Jan-02,DD-MON-YY,'YEAR',"Date" from Dual;

  2. Select TRUNC(To_Date('09-Jan-02,DD-MON-YY,YEAR')) "DATE" from Dual;

  3. Date =TRUNC(To_DATE('09-Jan-02','DD-MON-YY'),'YEAR'),'YEAR)"DATE: from DUAL;

  4. SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL;

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The TRUNC function in Oracle/PLSQL truncates a date to a specified precision. Correct syntax is TRUNC(date_value, format). Option D shows proper syntax: TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') truncates the date to the first day of the year. Other options have syntax errors like misplaced parentheses, missing quotes, or incorrect structure.