3 Simple solutions ( beats 100 % ): just replace + string split + string agg 👾👾👾
IntuitionApproachComplexity
Time complexity:

Space complexity:
PostgreSQL (One line with initcap)PostgreSQLSQL SERVERORACLE
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n![image.png](https://assets.leetcode.com/users/images/5b8784c5-b917-4691-8af5-2c364d9100df_1734066413.238526.png)\n\n# PostgreSQL (One line with initcap)\n```Postgresql []\nSELECT content_id , content_text original_text , INITCAP(content_text ) converted_text FROM user_content\n```\n\n# PostgreSQL\n```postgresql []\nWITH CTE AS ( SELECT content_id, content_text, unnest ( string_to_array ( REPLACE ( content_text, \'-\', \'  \' ), \' \' ) ) AS new_text FROM user_content ) SELECT\ncontent_id,\ncontent_text AS original_text,\nREPLACE (\n  STRING_AGG (\n    UPPER( SUBSTR( new_text, 1, 1 ) ) || LOWER( SUBSTR( new_text, 2, LENGTH( new_text ) - 1 ) ),\n    \' \' \n  ),\n  \' - \',\n  \'-\' \n) AS converted_text \nFROM\n  ( SELECT content_id, content_text, CASE WHEN new_text = \'\' THEN \'-\' ELSE new_text END FROM CTE ) sub \nGROUP BY\n  content_id,\n  content_text \nORDER BY\n  content_id\n```\n\n# SQL SERVER\n```mssql []\nWITH CTE AS ( SELECT content_id, content_text, REPLACE ( content_text, \'-\', \'  \' ) AS new_text FROM user_content ),\nCTE2 AS (\n  SELECT\n    content_id,\n    content_text,\n    UPPER( LEFT ( single_word, 1 ) ) + LOWER( SUBSTRING ( single_word, 2, total_word_length ) ) AS converted \n  FROM\n    (\n    SELECT\n      content_id,\n      content_text,\n      new_text,\n      spl.value single_word,\n      LEN ( spl.value ) total_word_length \n    FROM\n      CTE C OUTER APPLY string_split ( C.new_text, \' \' ) spl \n    ) sub \n  ) SELECT\n  content_id,\n  content_text AS original_text,\n  REPLACE ( STRING_AGG ( IIF ( converted = \'\', \'-\', converted ), \' \' ), \' - \', \'-\' ) AS converted_text \nFROM\n  CTE2 \nGROUP BY\n  content_id,\n  content_text \nORDER BY\n  content_id\n```\n\n# ORACLE\n```oracle []\nWITH CTE AS (\n  SELECT\n    content_id,\n    content_text,\n    REGEXP_SUBSTR( new_text, \'[^ ]+\', 1, LEVEL ) converted_single_text \n  FROM\n    ( SELECT content_id, content_text, REPLACE ( content_text, \'-\', \' -\' ) new_text FROM user_content ) sub CONNECT BY REGEXP_SUBSTR( new_text, \'[^ ]+\', 1, LEVEL ) IS NOT NULL \n    AND PRIOR content_id = content_id \n    AND PRIOR SYS_GUID ( ) IS NOT NULL \n  ),\n  CTE2 AS (\n  SELECT\n    content_id,\n    content_text,\n    DECODE( is_s, 1, \'-\' || converted_single_text2, converted_single_text2 ) AS converted_single_text3,\n    ROW_NUMBER ( ) OVER ( ORDER BY ( NULL ) ) keyid \n  FROM\n    (\n    SELECT\n      content_id,\n      content_text,\n      is_s,\n      UPPER( SUBSTR( converted_single_text, 1, 1 ) ) || LOWER( SUBSTR( converted_single_text, 2, LENGTH( converted_single_text ) ) ) converted_single_text2 \n    FROM\n      (\n      SELECT\n        content_id,\n        content_text,\n        REPLACE ( converted_single_text, \'-\', \'\' ) converted_single_text,\n      CASE\n          \n          WHEN converted_single_text LIKE \'%-%\' THEN\n          1 ELSE 0 \n        END is_s \nFROM\n  CTE \n  ) sub \n  ) sub1 \n  ) SELECT\n  content_id AS "content_id",\n  content_text AS "original_text",\n  REPLACE ( LISTAGG ( converted_single_text3, \' \' ) WITHIN GROUP ( ORDER BY keyid ), \' -\', \'-\' ) AS "converted_text" \nFROM\n  CTE2 \nGROUP BY\n  content_id,\n  content_text \nORDER BY\n  content_id;    \n```\n\n
['MySQL', 'Oracle', 'MS SQL Server', 'PostgreSQL']