Small and simple Solution for First Letter Capitalization II
IntuitionThe problem can be simplified by using Oracle's built-in INITCAP function to handle the capitalization of each word. INITCAP automatically converts the
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The problem can be simplified by using Oracle's built-in INITCAP function to handle the capitalization of each word. INITCAP automatically converts the first letter of each word to uppercase and the rest to lowercase. However, it doesn't fully handle hyphenated words.


# Approach
<!-- Describe your approach to solving the problem. -->
1. Use the INITCAP function: 
Directly applies capitalization rules to each word in the content_text column. 
Converts the first letter of every word to uppercase and the rest to lowercase.
2.  Special cases for hyphenated words:
The INITCAP function handles each part of the hyphenated word separately, resulting in correctly capitalized hyphenated words (e.g., top-rated → Top-Rated).
This approach is simple and leverages the power of Oracle's in-built functionality for most scenarios without additional complexity.


# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(n), where n is the total number of characters in the content_text column. Each character is processed once by INITCAP.

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(n), where n is the size of the resulting converted_text stored in memory.

![3374 First Letter Capitalization II.PNG](https://assets.leetcode.com/users/images/416cd565-b105-47b3-872e-bbca4b43c5c1_1736573649.1574624.png)



# Code
```oraclesql []
/* Write your PL/SQL query statement below */
SELECT content_id, 
    content_text AS original_text, 
    initcap(content_text) AS converted_text 
FROM user_content;
```
['Oracle']