SQLforGeeks
  • Home
  • SQL
  • SQL Tutorial
  • SQL Syntax
  • Our Services
Contact
  1. SQL
  2. IS NOT NULL operator

Text copied!

« Previous
Next »

IS NOT NULL operator

May 25, 2023, 5:33 p.m. under SQL

  • Hi! You should check IS NULL operator post first.

    In SQL, Operators are special character, symbol or a keyword that is used to perform some specific operations. For example : comparing data

    SQL operators are commonly used with SQL statements to retrieve, filter, and manipulate data.

    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 :
    SELECT column_name(s)
    FROM table_name
    WHERE column IS NOT NULL;
            

    • Specify the column(s) name after the 'SELECT' keyword.

    • Specify Asterisk (*) symbol to selects all columns from the table after the 'SELECT' keyword.

    • Specify the table name after the 'FROM' keyword.

    • Specify the conditions after the 'WHERE' keyword.

    • Specify the column_name before the 'IS NOT NULL' keyword to check if rows in that column are non-null or not.

    Here's an example of how you might use the IS NOT NULL operator :

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

    IS NOT NULL operator

    Let's assume you want to retrieve employee data from [Employees] table where employee's gender is non-empty or non-null.

    Run below SQL statement :

    SELECT * 
    FROM [Employees]
    WHERE Gender IS NOT NULL;
            

    Above statement will retrieve employee data where employee's gender is non-null or non-empty.

    IS NOT NULL operator
    To enhance your understanding of 'SQL operators', be sure to check out our next tutorial.

    Frequently Asked Questions :

    What is the not null operator in SQL?

    The NOT NULL operator in SQL ensures that a column cannot have a NULL value.

    Is not null or empty in SQL query?

    In SQL, "IS NOT NULL" checks if a column value is not NULL.

    Is not null vs != NULL in SQL?

    "IS NOT NULL" and "!= NULL" both check for non-NULL values, but the former is more explicit and preferred.

    How to include not null in SQL?

    In SQL, specify "NOT NULL" constraint when defining a column to ensure it cannot contain NULL values.
    Thank You! You should check EXISTS operator post next.
    « Previous
    Next »
    RELATED :

    What is SQL

    What is T-SQL

    Difference between DBMS and Data Warehouse

    Download SQL Server

    Install SQL Server

    Download SQL Server Management Studio SSMS

    SQL Server Management Studio

    SQL Database

    Download database

    Restore database

    Backup database

    Attach database

    Detach database

    Create database

    Delete database

    Rename database

    Select database

    Database offline

    Database online

    SQL Commands

    SQL Tables

    Create table

    Truncate table

    Delete table

    Rename table

    Select table

    Alter table

    SQL Data Types

    SQL Comments

    SQL Constraints

    SQL Joins

    SQL inner join

    SQL left join

    SQL right join

    SQL full join

    SQL cross join

    SQL self join

    INSERT INTO SELECT statement

    INSERT INTO statement

    SQL Clauses

    SELECT clause

    FROM clause

    WHERE clause

    GROUP BY clause

    HAVING clause

    ORDER BY clause

    JOIN clause

    UNION clause

    UNION ALL clause

    TOP clause

    DISTINCT clause

    SQL Operators

    SQL Arithmetic operators

    SQL Comparison operators

    SQL Logical operators

    UNION operator

    UNION ALL operator

    INTERSECT operator

    EXCEPT operator

    LIKE operator

    NOT LIKE operator

    IN operator

    NOT IN operator

    IS NULL operator

    EXISTS operator

    NOT EXISTS operator

    BETWEEN operator

    NOT BETWEEN operator

    SQL Functions

    SQL Built-In functions

    CHARINDEX function

    DATEADD function

    CONCAT function

    LEN function

    REPLACE function

    SUBSTRING function

    CASE statement

    GETDATE function

    DATEPART function

    DATEDIFF function

    CAST function

    TRY_CAST function

    CONVERT function

    TRY_CONVERT function

    ISNULL function

    NULLIF function

    COALESCE function

    SQL Window functions

    ROW_NUMBER function

    RANK function

    DENSE_RANK function

    IIF function

    CHOOSE function

    SQL Store Procedure

    Store Procedure vs. Function

    SQL Subquery

    SQL Aliases

    Temp table

    SQL Error Handling

    SQL Variables

    SQL Views

    SQL Merge

    SQL CTE

    SQL WITH TIES

    Define Transaction in DBMS

    ACID properties in DBMS

    Types of Triggers in DBMS


    • Have Some Questions?
    logo

    Elevate your data experience with SQL excellence

    Quick Links
    •  Home
    •  SQL Tutorial
    •  SQL Syntax
    •  Our Services
    Our Services
    • Web Development
    • BI Development
    • Data Warehousing
    • Data Integration ETL


    Follow Us

    GST Registered: XXAXXXXXXXZX
    Mumbai, Maharashtra, India support@sqlforgeeks.com

    © 2025 Copyright™ | All Rights Reserved | Privacy Policy