Skip to main contentSkip to solution

What is the output of the following SQL query?

select DAY ("2003-10-03");

Solution

✅ Correct Option: 1

The SQL function DAY(date) extracts the day-of-month number from the date given to it. For "2003-10-03" it returns the day part, which is 3.


Option 2: confuses DAY() with DAYNAME(), which returns the weekday name such as "Friday".

Options 3 and 4: the query passes a fixed date, so the system date is not used. The system date comes from functions like CURDATE() or NOW().

DAY() is a synonym of DAYOFMONTH(), while DAYOFWEEK() gives the weekday number.

Keyboard Shortcuts

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