0
0
SQLquery~10 mins

Why equals NULL fails in SQL - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check if the column 'age' is NULL.

SQL
SELECT * FROM users WHERE age [1] NULL;
Drag options to blanks, or click blank then click option'
A=
B!=
CIS
D<>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' to compare with NULL
Using '<>' to compare with NULL
2fill in blank
medium

Complete the code to find rows where 'score' is not NULL.

SQL
SELECT * FROM results WHERE score [1] NULL;
Drag options to blanks, or click blank then click option'
AIS NOT
B=
C!=
D<>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' or '<>' to check for NOT NULL
Using '=' instead of 'IS NOT'
3fill in blank
hard

Fix the error in the WHERE clause to correctly filter NULL values.

SQL
SELECT * FROM orders WHERE delivery_date [1] NULL;
Drag options to blanks, or click blank then click option'
A!=
BIS
C=
DLIKE
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or '!=' with NULL
Using 'LIKE' with NULL
4fill in blank
hard

Fill both blanks to correctly filter rows where 'status' is NULL or not NULL.

SQL
SELECT * FROM tasks WHERE status [1] NULL OR status [2] NULL;
Drag options to blanks, or click blank then click option'
AIS
BIS NOT
C=
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or '!=' instead of IS or IS NOT
Mixing up IS and IS NOT
5fill in blank
hard

Fill all three blanks to create a query that selects rows where 'comment' is NULL, 'rating' is not NULL, and 'approved' equals 1.

SQL
SELECT * FROM feedback WHERE comment [1] NULL AND rating [2] NULL AND approved [3] 1;
Drag options to blanks, or click blank then click option'
AIS
BIS NOT
C=
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or '!=' to compare with NULL
Using IS or IS NOT for normal values