SQL String Functions

This section provides you with some handy SQL string functions that allow you to manipulate string data more effectively.

NameDescription
ASCIIReturns ASCII code of the first character of a string
CHRReturns the character corresponding to the input ASCII code
CONCATReturns the result of the concatenation of two or more strings
LOWERConverts all characters in a string to lowercase
LENGTHReturns the number of characters in a given string. Some database systems use the LEN function instead.
SUBSTRINGExtracts a substring from a string
REPLACEReplaces all occurrences of a specified substring in a string by a new substring
TRIMRemoves unwanted characters e.g., whitespaces from a string
UPPERConverts all characters in a string to uppercase