Back to DATA RETRIEVAL & FILTERING

STRING FUNCTIONS

Understand `STRING` manipulation functions

12 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.

Ready to continue?

Mark this lesson as complete when you're ready to proceed.

Key moments

  1. LENGTH() Function — The LENGTH function returns the total number of characters in the specified string or column value.
  2. Casing Functions — UPPER and LOWER functions are used to standardize the casing of text data for consistency.
  3. TRIM Variants — TRIM, LTRIM, and RTRIM are used to remove unwanted whitespace from the ends of a string.
  4. LEFT and RIGHT — These functions extract a specified number of characters starting from either the beginning or the end of the string.
  5. SUBSTRING Function — SUBSTRING extracts a portion of a string based on a starting position and a defined length.
  6. REPLACE Function — REPLACE substitutes all occurrences of a specific character or sequence with a new one.
  7. LOCATE Function — LOCATE finds and returns the 1-based starting position of a substring within a larger string.
  8. CONCAT Function — CONCAT combines multiple columns or strings into a single, merged output field.
  9. Other Function Types — The lesson concludes by mentioning other function categories like Numeric and Date functions.
PDF notes

Frequently asked questions

Do these functions modify the data in the underlying table?

No, string functions only manipulate the data returned in the result set; they do not change the underlying table data.

What happens if LOCATE() doesn't find the substring I am searching for?

LOCATE() returns 0 if the specified substring is not found within the target string, allowing you to filter based on its absence.

Can I use string functions in WHERE clauses or only in SELECT statements?

You can use string functions in both SELECT statements (for display) and WHERE clauses (for filtering records based on string properties).

How was this lesson?

Your feedback helps us refine explanations and catch bugs.