LIKE Operator — Text Pattern Matching — Free SQL Tutorial
Learn LIKE Operator — Text Pattern Matching in SQL with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn LIKE Operator — Text Pattern Matching in SQL with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
LIKE Operator — Text Pattern Matching in SQL
LIKE matches text patterns. % matches any sequence (0 or more chars), _ matches exactly one char. Use LIKE with WHERE to find rows containing a substring.
Case sensitivity: LIKE is case-insensitive in MySQL, case-sensitive in PostgreSQL (use ILIKE for case-insensitive). Always use LOWER() for reliable case-insensitive searches.
Performance: LIKE %value% (leading wildcard) cannot use indexes. LIKE value% (trailing wildcard) can use an index for faster searches.
LIKE Operator — Text Pattern Matching — Syntax
WHERE name LIKE 'A%' -- starts with A WHERE name LIKE '%ar%' -- contains 'ar' anywhere WHERE name LIKE '_mail' -- 5 chars, ends in 'mail' WHERE name LIKE 'J%n' -- starts with J, ends with n WHERE email LIKE '%@gmail%' -- Gmail emails
Learn LIKE Operator — Text Pattern Matching step by step with Syllab's free interactive SQL tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full SQL course →