Working With NULL Value in SQL. The following SQL commands show how to work with a NULL value in the SQL query.
SQL IS NULL Syntax:
SELECT column_names
FROM table_name
WHERE column_name IS NULL;
Example:
SELECT name, email, country
FROM employees
WHERE city IS NULL;
SQL IS NOT NULL Syntax:
SELECT column_names
FROM table_name
WHERE column_name IS NOT NULL;
Example:
SELECT name, email, country
FROM Customers
WHERE city IS NOT NULL;