Skip to main content
SQL • LESSON 50

NOT LIKE

How can we exclude rows matching a text pattern?

Beginner3 Minutes630 XP
🤔 THE QUESTION

How can we exclude rows matching a text pattern?

💡 WHAT IS IT?

The NOT LIKE operator filters out all records whose string values match the specified pattern.

🎯 WHAT IS IT USED FOR?

Omitting test email accounts, excluding legacy prefix IDs, cleaning raw text datasets.

💻 EXAMPLE
SELECT name
FROM employees
WHERE name NOT LIKE 'A%';

🎯 Mission Objectives

Practice typing production-grade SQL code for NOT LIKE.

  • NOT LIKE
  • Pattern exclusion
  • Text cleansing
  • Negative matching