Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
See the whole table
Select some columns
Filtering rows
Logic
Text patterns
To be or NULL to be
19. Looking for NULL values
A little bit of mathematics
Let's practice

Instruction

Great! Remember, NULL is a special value. You can't use the equal sign to check whether something is NULL. It simply won't work. The opposite of IS NOT NULL is IS NULL.

SELECT id
FROM user
WHERE middle_name IS NULL;

This query will return only those users who don't have a middle name, i.e., their middle_name is unknown.

Exercise

Select all columns for each car whose price column has a NULL value.

Stuck? Here's a hint!

Type:

SELECT *
FROM car
WHERE price IS NULL;