CodeBlanks Logo Icon CodeBlanks

What is NULL?

Learn that NULL represents an unknown value.

What is NULL?

NULL means an unknown or missing value. It is not zero or empty text; it is the absence of a value.

SELECT name FROM customers
WHERE email IS NULL;

This query finds customers whose email was not entered.

name is selected from customers. WHERE keeps only the rows where email IS NULL holds.

What is NULL? — details

Arithmetic with NULL gives NULL. Even NULL = NULL is not true; always check with IS NULL.

Practice What is NULL?

Select names from customers where email is null.

Starter code

query.sql
-- null email
SELECT name
FROM customers
WHERE

Sample solution

query.sql
SELECT name
FROM customers
WHERE email IS NULL

Expected output

name
Mehmet
Zeynep

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What does NULL mean?

  • An empty string
  • An unknown value Correct answer
  • Zero
  • A negative number

Explanation: NULL is an unknown or missing value.

2 Null check

Question
SELECT name FROM customers
WHERE email ____;
Answer
SELECT name FROM customers
WHERE email IS NULL;

Explanation: IS NULL is the right answer.

3 What is NULL: match the terms

Term Meaning
NULL unknown
IS NULL null check
0 zero
'' empty text

All lessons in Beginner