Which of the following statements are correct?
A. SELECT DAY("2003-03-24"); ------ will return 24
B. SELECT MONTHNAME("2003-03-24"); ------ will return 03
C. SELECT YEAR(“2003-10- 03”); ------ will return 2003
D. SELECT DATE(NOW()); ------ will return date part of current system date
Which of the following statements are correct?
A. SELECT DAY("2003-03-24"); ------ will return 24
B. SELECT MONTHNAME("2003-03-24"); ------ will return 03
C. SELECT YEAR(“2003-10- 03”); ------ will return 2003
D. SELECT DATE(NOW()); ------ will return date part of current system date
Solution
A, C and D are correct. DAY() returns the day of the month, so A gives 24. YEAR() returns the year part, so C gives 2003. DATE(NOW()) strips the time from the current date and time, leaving only the date part, so D is correct.
Statement B is wrong because MONTHNAME("2003-03-24") returns the name March, not the number 03.
MONTH("2003-03-24") returns the number 3.
Related questions:
2025: 3 June Shift 2
2025: 20 May Shift 1
2025: 30 May Shift 2
2025: 3 June Shift 2