Beginner

166. Equal To Operator

Learn how the equals operator compares values in SQL.

📘 Lesson 166 of 728 ⏱ 7 min 🎯 Beginner

The equal-to operator (=) checks whether two expressions have equal values.

Equality comparisons are fundamental to filtering data and joining related information.

An analyst can find all employees whose department is exactly Finance.

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

The equals operator is used in filters, joins, conditional logic, data validation, and business reporting.

  • = compares values for equality.
  • It is commonly used with WHERE.
  • It can compare numbers, text, dates, and expressions.
  • It is commonly used in JOIN conditions.
  • NULL requires IS NULL instead of = NULL.
What does = mean in SQL?

The equals operator checks whether two expressions have equal values.

Can = be used to check NULL?

No. NULL should be checked using IS NULL because NULL represents an unknown or missing value.

Have you finished this lesson?

Introduction to SQL – All Lessons