Lesson 19: String Functions
20 Jul 2026 1 min Swarnil Singhai
SQL's string functions transform and search text directly in the database — often faster than pulling data out just to manipulate it in application code.
Real-time example
A search bar needs case-insensitive partial matching on product names.
SELECT name FROM products
WHERE LOWER(name) LIKE LOWER('%wireless%');
SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM customers;
SELECT UPPER(status), LENGTH(email) FROM orders o JOIN customers c ON true;
What's happening
LIKE with % wildcards does pattern matching; wrapping both sides in LOWER() makes the comparison case-insensitive.
For real full-text search at scale, a dedicated index (e.g. Postgres tsvector) beats LIKE '%...%', which can't use a normal index.
Advertisement