Question:

What will be the output of the following SQL command?
SELECT MONTHNAME('2024-08-02');

Show Hint

Remember: Use MONTH() to get the numeric month and MONTHNAME() to get the month’s full name.
Updated On: Jul 14, 2025
  • 08
  • 02
  • February
  • August
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

The given SQL statement uses the MONTHNAME() function.
This function takes a date as an argument and returns the full name of the month for that date.
In this case, the input date is '2024-08-02'.
Breaking down the date:
- The format is YYYY-MM-DD, so '2024-08-02' represents 2nd August, 2024.
- The month part is '08', which corresponds to the month of August.
When the MONTHNAME() function processes this date, it extracts the month number '08' and converts it to its full month name.
Therefore, MONTHNAME('2024-08-02') returns 'August'.
To confirm, here’s how it works in MySQL:
SELECT MONTHNAME('2024-08-02');

The result will be:
August

Hence, the correct output is August — Option (D).
Was this answer helpful?
0
0

Top Questions on SQL Queries

View More Questions

Questions Asked in CBSE CLASS XII exam

View More Questions