IS operator in SQL?

The IS operator is used only to compare with NULL.

In SQL:

IS NULL

To check if a value is NULL

IS NOT NULL

To check if a value is NOT NULL

Why can't we use = with NULL?

NULL = NULL is not true.

SQL treats NULL as unknown, not a value.

That's why:

WHERE allergy = NULLwrong

WHERE allergy IS NULLcorrec


LIKE Operator

Used to search for a pattern in text.