Introduction
These functions change the case of letters in text. They help make text look consistent or easier to read.
These functions change the case of letters in text. They help make text look consistent or easier to read.
UPPER(text) LOWER(text) INITCAP(text)
UPPER changes all letters to uppercase.
LOWER changes all letters to lowercase.
INITCAP capitalizes the first letter of each word and makes the rest lowercase.
SELECT UPPER('hello world');
SELECT LOWER('Hello WORLD');
SELECT INITCAP('hello world');
SELECT INITCAP('mY nAmE iS JoHN');
This query shows how each function changes the text.
SELECT UPPER('postgresql') AS upper_case, LOWER('PostgreSQL') AS lower_case, INITCAP('pOstGreSQL database') AS initcap_case;
These functions only affect letters; numbers and symbols stay the same.
INITCAP treats any non-letter as a word separator.
Use these functions to make text comparisons easier by normalizing case.
UPPER makes all letters uppercase.
LOWER makes all letters lowercase.
INITCAP capitalizes the first letter of each word.
UPPER function do to a text string in PostgreSQL?name to lowercase in PostgreSQL?users with a column fullname containing 'john DOE', what is the output of the query SELECT INITCAP(fullname) FROM users;?SELECT INITCAP fullname FROM employees;products table where each word in the product name starts with a capital letter, but the rest of the letters are lowercase. Which query achieves this?Pass the test and this pattern moves unknown