What is output of the following SQL statement?
SELECT DAY("2024-12-10");
What is output of the following SQL statement?
SELECT DAY("2024-12-10");
Solution
✅ Correct Option: 2
DAY() returns the day of the month (1 to 31) from a date. In "2024-12-10" (format YYYY-MM-DD), the day part is 10.
Option 1: 2024 is the year, returned by YEAR().
Option 3: 12 is the month, returned by MONTH().
Option 4: Tuesday is the weekday name, returned by DAYNAME(), not DAY().
Related questions:
2025: 15 May Shift 2
2025: 20 May Shift 1
2026: 21 May Shift 1
2025: 14 May Shift 1