Module lessons (1/4)
String Functions
LOWER, UPPER, LENGTH, concatenation, SUBSTRING, TRIM, REPLACE, LIKE, and ILIKE.
What you'll learn in this lesson
- Normalize, measure, and extract text with
LOWER,UPPER,LENGTH,TRIM,REPLACE, andSUBSTRING. - Distinguish the operator
||(propagateNULL) from the functionCONCAT(...)(ignoreNULL). - Search for patterns case-sensitive (
LIKE) or case-insensitive (ILIKE).
Overview
Textual data coming from forms, CSV imports or external integrations almost always arrives dirty: inconsistent capitalization, extra spaces at the edges, email domains that need to be normalized. PostgreSQL provides a complete suite of string functions that can be composed directly into queries.
Observe in the stepper how a predicate WHERE (for example ILIKE '%laptop%') filters the rows before the functions in SELECT are calculated:
Sections covered in this lesson
- 11. Mental Model: Transformation, Concatenation and Pattern Matching
- 22. Progressive & Annotated Examples
- 33. Interactive Laboratory: String Filters before SELECT
- 44. Diagnostic Verification (Quiz)
- 55. Progressive Practical Laboratory
Unlock "String Functions" and the full SQL Course curriculum
LOWER, UPPER, LENGTH, concatenation, SUBSTRING, TRIM, REPLACE, LIKE, and ILIKE.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in SQL Course plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.