Blog · Guide

SQL LIKE Explained: Pattern Matching with % and _

LIKE lets you match text patterns — starts with, ends with, contains — using % and _ wildcards.

all rows WHERE kept rows
WHERE keeps only the rows that match your condition.

The two wildcards

SELECT name
FROM products
WHERE name LIKE 'Ch%';

That finds names starting with “Ch” (Cheese, Chips…).

Contains a word

LIKE '%tea%' matches anywhere in the string. Useful for search-box style filters — just know it can be slower on huge tables.

Try it yourself

The fastest way to lock this in is a short drill on the same Northstar Market tables.

Practice WHERE LIKE

Related guides