IS NOT NULL operator | SQL Tutorial and Query Example

Text copied!

IS NOT NULL operator


  • IS NOT NULL operator :

    IS NOT NULL operator is used to check if a column contains non-null or non-empty rows. It is exact opposite of 'IS NULL' operator and used in 'WHERE' clause to filter rows based on non-null rows.

    The syntax of the IS NOT NULL operator generally looks like this :
    Here's an example of how you might use the IS NOT NULL operator :

    1. Let's assume we have a table named "[Employees]".

    To enhance your understanding of 'SQL operators', be sure to check out our next tutorial.
    SELECT column_name(s)
    FROM table_name
    WHERE column IS NOT NULL;
            
    IS NOT NULL operator
    SELECT * 
    FROM [Employees]
    WHERE Gender IS NOT NULL;
            
    IS NOT NULL operator

    Frequently Asked Questions :

    The NOT NULL operator in SQL ensures that a column cannot have a NULL value.
    In SQL, "IS NOT NULL" checks if a column value is not NULL.
    "IS NOT NULL" and "!= NULL" both check for non-NULL values, but the former is more explicit and preferred.
    In SQL, specify "NOT NULL" constraint when defining a column to ensure it cannot contain NULL values.