Beginner

360. NOT Operator

Learn how to reverse the result of a SQL condition.

📘 Lesson 360 of 728 ⏱ 9 min 🎯 Beginner

The NOT logical operator reverses a Boolean condition, turning true into false and false into true.

NOT allows analysts to express exclusion rules and select records that do not satisfy a specified condition.

Find employees who are not in the Finance department.

SQL
SELECT
    EmployeeName,
    Department
FROM Employees
WHERE NOT Department = 'Finance';

NOT is useful for exclusion rules, exception reporting, data validation, and filtering unwanted categories.

  • NOT reverses a condition.
  • It can be used with comparison conditions.
  • It supports exclusion logic.
  • It can be combined with AND and OR.
  • NOT IN and NOT LIKE are common related forms.
What does NOT do?

NOT reverses the logical result of a condition.

What is a common use of NOT?

NOT is commonly used to exclude records that match a specified condition.

Have you finished this lesson?

Introduction to SQL – All Lessons