Beginner

240. INITCAP Function

Learn how to capitalize the first letter of words in text where supported.

📘 Lesson 240 of 728 ⏱ 8 min 🎯 Intermediate

The INITCAP function converts the first character of words to uppercase and other characters according to the function's rules. Availability and behavior vary between database systems.

Consistent capitalization can improve the readability and presentation of names, descriptions, and labels.

Convert a customer name into title-style capitalization.

SQL
SELECT
    INITCAP(CustomerName) AS FormattedName
FROM Customers;

INITCAP can be useful for customer names, addresses, labels, and presentation-ready reporting fields.

  • INITCAP can capitalize words.
  • It is useful for presentation formatting.
  • Behavior varies between databases.
  • It can improve text readability.
  • It should be used carefully with names and special cases.
What does INITCAP do?

INITCAP converts text into a capitalization style where the first character of words is capitalized according to the database's rules.

Is INITCAP available in every database?

No. INITCAP is not supported identically across all database systems.

Have you finished this lesson?

Introduction to SQL – All Lessons