NULL Operator

Purpose: Tests for NULL values in a column.

Syntax


column_name IS NULL

or

column_name IS NOT NULL

Example:

SELECT * FROM employees WHERE department_id IS NULL;

Explanation: This retrieves employees who do not belong to any department.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *