Solution with STRING_SPLIT ans STRING_AGG
Code\nmssql []\n/* Write your T-SQL query statement below */\nWITH ToLower (content_id, original_text, lower_case) AS (\n    SELECT content_id, content_text, LO
# Code\n```mssql []\n/* Write your T-SQL query statement below */\nWITH ToLower (content_id, original_text, lower_case) AS (\n    SELECT content_id, content_text, LOWER(content_text)\n    FROM user_content\n),\nCapitalize1 (content_id, original_text, word) AS (\n    SELECT content_id, original_text, UPPER(SUBSTRING([value], 1, 1)) + SUBSTRING([value], 2, LEN([value]))\n    FROM ToLower CROSS APPLY STRING_SPLIT(lower_case, \' \')\n),\nStringAgg1 (content_id, original_text, converted_text) AS (\n    SELECT content_id, original_text, STRING_AGG(word, \' \')\n    FROM Capitalize1\n    GROUP BY content_id, original_text\n),\nCapitalize2 (content_id, original_text, segment) AS (\n    SELECT content_id, original_text, UPPER(SUBSTRING([value], 1, 1)) + SUBSTRING([value], 2, LEN([value]))\n    FROM StringAgg1 CROSS APPLY STRING_SPLIT(converted_text, \'-\')\n),\nStringAgg2 (content_id, original_text, converted_text) AS (\n    SELECT content_id, original_text, STRING_AGG(segment, \'-\')\n    FROM Capitalize2\n    GROUP BY content_id, original_text\n)\nSELECT content_id, original_text, converted_text\nFROM StringAgg2\nORDER BY content_id\n```
['MS SQL Server']