Quick Reference
This is a quick reference list of MySQL string functions and how they are used to work with databases.
- SQL – MySQL ASCII() FunctionThe MySQL ASCII() function returns the ASCII value for the specific character.
- SQL – MySQL CHAR_LENGTH() FunctionThe MySQL CHAR_LENGTH() function returns the length of a string in characters.
- SQL – MySQL CHARACTER_LENGTH() FunctionThe MySQL CHARACTER_LENGTH() function returns the length of a string in characters.
- SQL – MySQL CONCAT() FunctionThe MySQL CONCAT() function adds two or more expressions together.
- SQL – MySQL CONCAT_WS() FunctionThe MySQL CONCAT_WS() function adds two or more expressions together using a separator.
- SQL – MySQL FIELD() FunctionThe MySQL FIELD() function returns the index position of a case-insensitive value in a list of values.
- SQL – MySQL FIND_IN_SET() FunctionThe MySQL FIND_IN_SET() function returns the position of a string within a list of strings.
- SQL – MySQL FORMAT() FunctionThe MySQL FORMAT() function formats a number to a format like “#,###,###.##”, rounded to a specified number of decimal places, and returns it as a string.
- SQL – MySQL INSERT() FunctionThe MySQL INSERT() function inserts a string within a string at the specified position and for a certain number of characters.
- SQL – MySQL INSTR() FunctionThe MySQL INSTR() function returns the position of the first occurrence of a case-insensitive string in another string.
- SQL – MySQL LCASE() FunctionThe MySQL LCASE() function converts a string to lower-case.
- SQL – MySQL LEFT() FunctionThe MySQL LEFT() function extracts a number of characters from a string, starting from left.
- SQL – MySQL LENGTH() FunctionThe MySQL LENGTH() function returns the length of a string in bytes.
- SQL – MySQL LOCATE() FunctionThe MySQL LOCATE() function returns the position of the first occurrence of a case-insensitive substring in a string.
- SQL – MySQL LOWER() FunctionThe MySQL LOWER() function converts a string to lower case.
- SQL – MySQL LPAD() FunctionThe MySQL LPAD() function left-pads a string with another string, to achieve a specified length.
- SQL – MySQL LTRIM() FunctionThe MySQL LTRIM() function removes leading spaces from a string.
- SQL – MySQL MID() FunctionThe MySQL MID() function extracts a substring from a string, starting at any position from the beginning or end of the string.
- SQL – MySQL POSITION() FunctionThe MySQL POSITION() function returns the position of the first occurrence of a case-insensitive substring in a string.
- SQL – MySQL REPEAT() FunctionThe MySQL REPEAT() function repeats a string as many times as specified.
- SQL – MySQL REPLACE() FunctionThe MySQL REPLACE() function replaces all case-sensitive occurrences of a substring within a string, with a new substring.
- SQL – MySQL REVERSE() FunctionThe MySQL REVERSE() function reverses a string and returns the result.
- SQL – MySQL RIGHT() FunctionThe MySQL RIGHT() function extracts a number of characters from a string, starting from right.
- SQL – MySQL RPAD() FunctionThe MySQL RPAD() function right-pads a string with another string, to achieve a specified length.
- SQL – MySQL RTRIM() FunctionThe MySQL RTRIM() function removes trailing spaces from a string.
- SQL – MySQL SPACE() FunctionThe MySQL SPACE() function returns a string of the specified number of space characters.
- SQL – MySQL STRCMP() FunctionThe MySQL STRCMP() function compares the lengths two strings.
- SQL – MySQL SUBSTR() FunctionThe MySQL SUBSTR() function extracts a substring from a string, starting from any position.
- SQL – MySQL SUBSTRING() FunctionThe MySQL SUBSTRING() function extracts a substring from a string, starting from any position.
- SQL – MySQL SUBSTRING_INDEX() FunctionThe MySQL SUBSTRING_INDEX() function returns a substring of a string before a specified number of delimiter occurs.
- SQL – MySQL TRIM() FunctionThe MySQL TRIM() function removes leading and trailing spaces from a string.
- SQL – MySQL UCASE() FunctionThe MySQL UCASE() function converts a string to upper case.
- SQL – MySQL UPPER() FunctionThe MySQL UPPER() function converts a string to upper case.
SQL Notes:
- Any work being done to modify the structure of a database or delete tables or the the database itself should only be done after making a recent backup
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.