SQL Server Interview Question #18
What is NULL in SQL Server?
SQL Server Fundamentals Junior Beginner
Detailed Explanation
NULL represents a missing, unknown, or unavailable value. It is not the same as zero, an empty string, or FALSE.
NULL should normally be checked using IS NULL or IS NOT NULL rather than = NULL. SQL uses three-valued logicβTRUE, FALSE, and UNKNOWNβso NULL can affect comparisons, filters, joins, and expressions in ways that interview candidates should understand.
Code Example
SELECT *
FROM Customers
WHERE MiddleName IS NULL;
SELECT *
FROM Customers
WHERE MiddleName IS NOT NULL;