______ function is used to get a specified day of the month for a given date.
______ function is used to get a specified day of the month for a given date.
Solution
✅ Correct Option: 2
The DAY() function takes a date and returns the day of the month (1 to 31) as a number. For example, DAY('2024-03-15') returns 15.
Option 1: GETDATE() returns the current system date and time (SQL Server). It does not extract a part of a given date.
Option 3: DATE() extracts the date part from a date-time value in MySQL, so it returns the whole date rather than the day number.
Option 4: CURRENTDATE() is not a standard SQL function. The usual forms are CURDATE() or CURRENT_DATE.
Related questions:
2025: 16 May Shift 1
2026: 23 May Shift 2
2025: 20 May Shift 1
2026: 18 May Shift 2