IS NULL Check in SQL

Level 243 keystrokes

IS NULL checks for NULL values in a column.

SQL code

1SELECT
-- Returns the name of each matching user
2 name
3FROM
4 users
-- Keeps users that have no email address (NULL = missing value)
5WHERE
-- Use IS NULL: email = NULL is never true, because any comparison with NULL is unknown
6 email IS NULL;

Output

+-------+
| name  |
+-------+
| Guest |
| Admin |
+-------+
2 rows in set
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this SQL code and how often they appear.

  • ;× 1

More SQL examples at level 2

← SQL typing practice