Multiple choice

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

Option D demonstrates the correct TRUNC function syntax with proper date formatting and string quoting. TRUNC accepts a date value and a format string, returning the date truncated to the specified precision level - in this case, 'YEAR' truncates to January 1st of that year. Options A, B, and C contain syntax errors including missing closing parentheses, incorrect quote usage, malformed function calls, and improper string literal formatting. The correct syntax requires TRUNC(date_value, format_string) with proper parentheses and string quotes.