IS is a comparison keyword used in SQL predicates to test the three-valued logic states of an expression. It returns TRUE when the expression exactly matches the specified logical constant (NULL, TRUE, FALSE, or UNKNOWN) and FALSE otherwise. Because NULL represents an unknown value, the normal equality operator (=) cannot be used to test for it. IS provides a deterministic, standard-compliant way to handle NULL checks and boolean truthiness. Many dialects also support IS NOT to invert the result and IS DISTINCT FROM for null-safe equality, but those are extensions beyond the core IS predicate.Behavior notes:- IS NULL and IS NOT NULL work on any data type.- IS TRUE, IS FALSE, and IS UNKNOWN operate on boolean expressions. Dialects without a native BOOLEAN type (e.g., MySQL before 8.0) treat TRUE as 1 and FALSE as 0.- The predicate short-circuits; no additional evaluation cost beyond the expression itself.- Unlike = NULL, which always yields UNKNOWN, expr IS NULL produces TRUE or FALSE, making it indexable and optimizer-friendly.
IS NOT NULL, IS DISTINCT FROM, NULL handling, three-valued logic, boolean data type
SQL-92
Using = NULL or <> NULL always yields UNKNOWN. IS NULL and IS NOT NULL correctly test for nullability and return TRUE or FALSE.
In systems like MySQL or SQLite, TRUE maps to 1 and FALSE to 0, so IS TRUE checks for nonzero and IS FALSE for zero. However, a NULL will not satisfy either.
IS NULL and IS NOT NULL are generally sargable. Many databases can use indexes or filtered indexes when these predicates appear in WHERE clauses.
Use IS UNKNOWN when you must explicitly capture rows where a boolean expression cannot be determined due to NULL operands, such as in advanced data quality checks.