SQL provides built-in string functions to manipulate text data easily.
UPPER(text)
— Converts all letters to uppercaseLOWER(text)
— Converts all letters to lowercaseTRIM(text)
— Removes leading and trailing spacesSUBSTRING(text, start, length)
— Extracts a portion of a stringREPLACE(text, old, new)
— Replaces occurrences of a substring with anotherTo display student names in uppercase and remove extra spaces:
SELECT UPPER(TRIM(name)) FROM students;
You can combine functions to format or clean data for reports and analysis.
Try using these functions to manipulate text fields in your queries!