Skip to main content
Module 6 · Lesson 1 of 421/57 in the course~14 min
Module lessons (1/4)

String Functions

Lesson preview5 hands-on exercises readySQL Course · Module 6 — Built-in 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, and SUBSTRING.
  • Distinguish the operator || (propagate NULL) from the function CONCAT(...) (ignore NULL).
  • 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

  1. 11. Mental Model: Transformation, Concatenation and Pattern Matching
  2. 22. Progressive & Annotated Examples
  3. 33. Interactive Laboratory: String Filters before SELECT
  4. 44. Diagnostic Verification (Quiz)
  5. 55. Progressive Practical Laboratory
Pro Lesson · Module 6 — Built-in Functions

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.