Skip to main contentSkip to solution

Identify the correct output produced by the following SQL command.

SELECT MONTH('2003/12/11');

Solution

✅ Correct Option: 3

The MySQL function MONTH()\text{MONTH()} returns the month of a date as a number from 1 to 12. The date string is in the format YYYY/MM/DD, so '2003/12/11' means year 2003, month 12, day 11. The output is therefore 12.


Option 1: 11 is the day of the date, which DAY()\text{DAY()} would return, not the month.

Option 2: DECEMBER is the month name, which is returned by MONTHNAME()\text{MONTHNAME()}, not MONTH()\text{MONTH()}.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question