First Letter Capitalization II
<p>Table: <code>user_content</code></p>

<pre>
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| content_id  | int     |
| content_text| varchar |
+-------------+---------+
content_id is the unique key for this table.
Each row contains a unique ID and the corresponding text content.
</pre>

<p>Write a solution to transform the text in the <code>content_text</code> column by applying the following rules:</p>

<ul>
	<li>Convert the <strong>first letter</strong> of each word to <strong>uppercase</strong> and the <strong>remaining</strong> letters to <strong>lowercase</strong></li>
	<li>Special handling for words containing special characters:
	<ul>
		<li>For words connected with a hyphen <code>-</code>, <strong>both parts</strong> should be <strong>capitalized</strong> (<strong>e.g.</strong>, top-rated&nbsp;&rarr; Top-Rated)</li>
	</ul>
	</li>
	<li>All other <strong>formatting</strong> and <strong>spacing</strong> should remain <strong>unchanged</strong></li>
</ul>

<p>Return <em>the result table that includes both the original <code>content_text</code> and the modified text following the above rules</em>.</p>

<p>The result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example:</strong></p>

<div class="example-block">
<p><strong>Input:</strong></p>

<p>user_content table:</p>

<pre class="example-io">
+------------+---------------------------------+
| content_id | content_text                    |
+------------+---------------------------------+
| 1          | hello world of SQL              |
| 2          | the QUICK-brown fox             |
| 3          | modern-day DATA science         |
| 4          | web-based FRONT-end development |
+------------+---------------------------------+
</pre>

<p><strong>Output:</strong></p>

<pre class="example-io">
+------------+---------------------------------+---------------------------------+
| content_id | original_text                   | converted_text                  |
+------------+---------------------------------+---------------------------------+
| 1          | hello world of SQL              | Hello World Of Sql              |
| 2          | the QUICK-brown fox             | The Quick-Brown Fox             |
| 3          | modern-day DATA science         | Modern-Day Data Science         |
| 4          | web-based FRONT-end development | Web-Based Front-End Development |
+------------+---------------------------------+---------------------------------+
</pre>

<p><strong>Explanation:</strong></p>

<ul>
	<li>For content_id = 1:
	<ul>
		<li>Each word&#39;s first letter is capitalized: &quot;Hello World Of Sql&quot;</li>
	</ul>
	</li>
	<li>For content_id = 2:
	<ul>
		<li>Contains the hyphenated word &quot;QUICK-brown&quot; which becomes &quot;Quick-Brown&quot;</li>
		<li>Other words follow normal capitalization rules</li>
	</ul>
	</li>
	<li>For content_id = 3:
	<ul>
		<li>Hyphenated word &quot;modern-day&quot; becomes &quot;Modern-Day&quot;</li>
		<li>&quot;DATA&quot; is converted to &quot;Data&quot;</li>
	</ul>
	</li>
	<li>For content_id = 4:
	<ul>
		<li>Contains two hyphenated words: &quot;web-based&quot; &rarr; &quot;Web-Based&quot;</li>
		<li>And &quot;FRONT-end&quot; &rarr; &quot;Front-End&quot;</li>
	</ul>
	</li>
</ul>
</div>

[]
['CREATE TABLE If not exists user_content (\n    content_id INT,\n    content_text VARCHAR(255)\n)', 'Truncate table user_content', "insert into user_content (content_id, content_text) values ('1', 'hello world of SQL')", "insert into user_content (content_id, content_text) values ('2', 'the QUICK-brown fox')", "insert into user_content (content_id, content_text) values ('3', 'modern-day DATA science')", "insert into user_content (content_id, content_text) values ('4', 'web-based FRONT-end development')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef capitalize_content(user_content: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["CREATE TABLE If not exists user_content (\n    content_id INT,\n    content_text VARCHAR(255)\n)"], "mssql": ["CREATE TABLE user_content (\n    content_id INT,\n    content_text VARCHAR(255)\n)"], "oraclesql": ["CREATE TABLE user_content (\n    content_id NUMBER,\n    content_text VARCHAR2(255)\n)"], "database": true, "name": "capitalize_content", "pythondata": ["user_content = pd.DataFrame({\n    'content_id': pd.Series(dtype='int'),\n    'content_text': pd.Series(dtype='str')\n})"], "postgresql": ["CREATE TABLE IF NOT EXISTS user_content (\n    content_id SERIAL PRIMARY KEY,\n    content_text VARCHAR(255)\n);\n"], "database_schema": {"user_content": {"content_id": "INT", "content_text": "VARCHAR(255)"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']