SELECT CONCAT(
UPPER(SUBSTRING(word, 1, 1)),
LOWER(SUBSTRING(word, 2, LENGTH(word) - 1)),
IF(LOCATE(' ', word) > 0, CONCAT(' ',
UPPER(SUBSTRING(word, LOCATE(' ', word) + 1, 1)),
LOWER(SUBSTRING(word, LOCATE(' ', word) + 2, LENGTH(word) - LOCATE(' ', word) - 1))
), '')
) AS capitalized_word
FROM your_table;
Thanks you for commenting your questions. I will see question and respond you.