NEW
Also known as: NULL, Missing Value
A special marker in databases indicating missing, unknown, or inapplicable data, requiring three-valued logic and special handling.
DESCRIPTION
Null represents absence of a value in relational systems and differs from zero or empty strings. SQL uses three-valued logic where comparisons with null yield unknown, affecting predicates and joins. Functions like COALESCE or NVL provide fallbacks, and constraints like NOT NULL restrict null usage. Analytical systems and programming languages may treat nulls/NaNs differently, requiring careful data cleaning and imputation. Null semantics impact indexing, unique constraints, and aggregations.
ALTERNATIVE DEFINITIONS
Wikipedia
Null, or NULL, is a special marker used in SQL to indicate that a data value does not exist in the database.
Clear distinction from existing but empty values; emphasizes absence of a value.
PostgreSQL
Ordinary comparison operators yield null (signifying “unknown”) when either input is null.
Emphasizes SQL’s three-valued logic behavior with nulls in comparisons.
RELATED TERMS
Three-Valued Logic Outer Join COALESCE IS NULL Default Value Imputation Primary Key Not Null Constraint Missing Data
COMPETING TERMS
NaN Empty String
KNOWLEDGE AREAS
Data Storage & Operations Data Modeling Data Quality
TARGET AUDIENCE
Data Engineer Data Analyst Data Scientist Data Steward BI Specialist
EXTERNAL SOURCES
- Wikipedia - Null (SQL)
- MySQL - Working with NULLs in MySQL
- Oracle - Null semantics in Oracle SQL
- Google BigQuery - NULL handling in BigQuery
TOP QUESTIONS
How does a Null Value differ from zero or empty string?
Null means missing or unknown; zero or empty string are actual values. Comparisons and aggregations treat them differently.
Category: Misunderstanding
How do Null Values affect joins?
Nulls can prevent matches in equality joins and influence outer join results via three-valued logic.
Category: Techniques
What constraints interact with Null Values?
NOT NULL forbids nulls; UNIQUE often allows multiple nulls depending on DBMS semantics.
Category: Concepts
How to handle Null Values in analytics?
Use COALESCE/IFNULL, impute, or filter appropriately. Always document imputation logic.
Category: Techniques
What are common mistakes around Null Values?
Assuming null equals empty string, using equality to test nulls, and ignoring null-driven logic in filters.
Category: Mistakes
How do programming languages represent Null Values?
SQL NULL differs from NaN in numeric computing and from None/null in languages; conversions need care.
Category: Comparison
Do Null Values impact indexes?
Yes, some indexes exclude nulls; uniqueness and filtering behavior varies by DBMS.
Category: Operations
What is three-valued logic with Null Values?
SQL evaluations can be true, false, or unknown; comparisons with null yield unknown.
Category: Basics
How should Null Values be governed?
Define semantics, allowable nulls, and imputation policies; enforce with constraints and data quality rules.
Category: Governance