What is the output of the following SQL query?
select DAY ("2003-10-03");
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.
Related questions:
2025: 20 May Shift 1
2025: 30 May Shift 2
2025: 3 June Shift 2