Beginner

374. NULL vs Empty String

Understand the difference between NULL and an empty text value.

📘 Lesson 374 of 728 ⏱ 9 min 🎯 Beginner

NULL represents a missing or unknown value, while an empty string is a text value containing zero characters.

This distinction is important during data cleaning and validation because missing text and intentionally blank text can represent different business meanings.

A customer's phone number may be NULL because it was never provided, while an empty string may indicate that the field was intentionally left blank.

SQL
SELECT
    CustomerName,
    Email
FROM Customers
WHERE Email IS NULL
   OR Email = '';

Data Analysts use this distinction when cleaning customer, employee, product, and operational datasets.

  • NULL and empty strings are different concepts.
  • NULL represents missing or unknown information.
  • An empty string contains zero characters.
  • Use IS NULL for NULL values.
  • Use = '' for an empty string where supported.
Is an empty string the same as NULL?

No. An empty string is a text value with zero characters, while NULL represents missing or unknown information.

How can both be checked?

Use IS NULL for NULL and = '' for an empty string.

Have you finished this lesson?

Introduction to SQL – All Lessons