Multiple choice technology databases

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

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

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

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

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

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

The syntax SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL; is syntactically valid in Oracle SQL, truncating the date to the first day of that year and using an alias. Option 566652 is also valid SQL but lacks the column alias, whereas options 566653 and 566654 use completely invalid syntax. Both 566651 and 566652 work, but 566651 is chosen as correct.