How to Capitalize Each Words' First Letter in PostgreSQL Database: PostgreSQL Operators: INITCAP() Table of Contents Problem: Example: Solution: Discussion: Problem: In a PostgreSQL string, you need to make the first letter of each word uppercase and the rest of the letters lowercase. Example: Our database has a table named student with data in two columns, id and full_name. idfull_name 1ANNE WILLIAMS 2alice brown 3Gary JACKSON Let’s change the capitalization of students’ full names by converting this string so that only the first letters of the first and last names are capitalized – just as we’d normally write them. Solution: We’ll use the INITCAP() function. Here’s the query you’d write: SELECT INITCAP (full_name) AS new_full_name FROM student; Here’s the result: new_full_name Anne Williams Alice Brown Gary Jackson Discussion: In PostgreSQL, you can use the INITCAP() function to convert a string to a new string that capitalizes the first letter of every word. All other letters will be lowercase. This function takes one parameter as a string and changes the capitalization for each word as described. In our example, the full name Anne Williams was originally stored in the column full_name as ANNE WILLIAMS; after converting, this full name is Anne Williams. Recommended courses: SQL Basics in PostgreSQL SQL Practice Set in PostgreSQL Common PostgreSQL Functions Recommended articles: PostgreSQL Cheat Sheet Standard SQL Functions Cheat Sheet 5 SQL Functions for Manipulating Strings 18 Useful Important SQL Functions to Learn ASAP 19 PostgreSQL Practice Exercises with Detailed Solutions Best Books for Learning PostgreSQL PostgreSQL Date Functions See also: How to Change Text to Lowercase in SQL How to Convert a String to Uppercase in SQL How to Trim Strings in SQL How to Remove Trailing Zeros from a Decimal in PostgreSQL Subscribe to our newsletter Join our monthly newsletter to be notified about the latest posts. Email address How Do You Write a SELECT Statement in SQL? What Is a Foreign Key in SQL? Enumerate and Explain All the Basic Elements of an SQL Query