Beginner

365. LIKE Operator

Learn how to search text values using patterns.

📘 Lesson 365 of 728 ⏱ 10 min 🎯 Beginner

The LIKE operator performs pattern matching on character data. It commonly works with wildcard characters such as % and _.

LIKE is essential when you need to find records based on partial text rather than an exact value.

Find employees whose names start with the letter A.

SQL
SELECT
    EmployeeName
FROM Employees
WHERE EmployeeName LIKE 'A%';

LIKE is used for customer searches, name matching, product searches, email filtering, address analysis, and data-quality checks.

  • LIKE performs pattern matching.
  • % represents zero or more characters in common SQL implementations.
  • _ represents a single character.
  • LIKE is commonly used with text columns.
  • NOT LIKE can exclude matching patterns.
What is LIKE used for?

LIKE is used to search text values using patterns.

What does % mean in LIKE?

The percent wildcard generally represents zero or more characters.

Have you finished this lesson?

Introduction to SQL – All Lessons