Beginner

352. Equal To Operator

Learn how to compare values using the equal to operator.

📘 Lesson 352 of 728 ⏱ 8 min 🎯 Beginner

The equal to operator (=) checks whether two expressions have the same value.

Equality comparisons are fundamental to filtering records and matching business conditions.

Find employees whose department is IT.

SQL
SELECT
    EmployeeName,
    Department
FROM Employees
WHERE Department = 'IT';

The equal operator is widely used for filtering departments, statuses, IDs, categories, and other exact business values.

  • The equal operator is =.
  • It checks whether values match.
  • It is commonly used in WHERE.
  • It can compare numbers, text, dates, and expressions.
  • NULL requires IS NULL instead.
What operator is used for equality in SQL?

The equal sign (=) is used to compare whether two expressions have the same value.

Can = be used to find NULL values?

No. NULL should be checked using IS NULL.

Have you finished this lesson?

Introduction to SQL – All Lessons