LIKE matches text against a pattern
LIKE compares a column to a pattern instead of an exact string. The percent sign is a wildcard: it stands for any run of characters. So 'garden%' means starts with garden, and '%garden%' means contains garden anywhere. Every other character in the pattern still has to appear exactly as written.
A tiny example
In plain English: Show me the titles of the books with the word garden somewhere in them.
SELECT title
FROM books
WHERE title LIKE '%garden%';What comes back
| title |
|---|
| The Garden Path |
| Midnight Garden |
These are the only titles with the word garden somewhere inside them.
Related SQL lessons
Ready for a break?
Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.
play today's sip