Multiple choice technology programming languages

What is the result of the query SELECT add_months('15-Jan-2011',-2) from DUAL ?

  1. 15-Dec-2010

  2. 15-Nov-2010

  3. 15-Mar-2011

  4. 15-Nov-2011

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

add_months('15-Jan-2011', -2) subtracts 2 months from the given date. January minus 2 months is November of the previous year, so the result is 15-Nov-2010. The function handles year boundaries correctly when adding or subtracting months.