0
0
SQLquery~10 mins

NULL behavior in comparisons in SQL - Interactive Code Practice

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

Complete the code to select rows where the column 'age' is NULL.

SQL
SELECT * FROM users WHERE age [1] NULL;
Drag options to blanks, or click blank then click option'
AIS
B=
C!=
D<>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or '!=' to compare with NULL.
Forgetting that NULL is not equal to anything, even NULL.
2fill in blank
medium

Complete the code to select rows where 'score' is NOT NULL.

SQL
SELECT * FROM results WHERE score [1] NULL;
Drag options to blanks, or click blank then click option'
A!=
BIS NOT
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 rows where 'date' is NULL.

SQL
SELECT * FROM events WHERE date [1] NULL;
Drag options to blanks, or click blank then click option'
A=
BLIKE
CIS
DIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' to compare with NULL.
Using string matching operators like LIKE with NULL.
4fill in blank
hard

Fill both blanks to select rows where 'status' is NULL or 'priority' is NOT NULL.

SQL
SELECT * FROM tasks WHERE status [1] NULL OR priority [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 the order of NULL checks.
5fill in blank
hard

Fill all three blanks to select rows where 'email' is NULL, 'phone' is NOT NULL, and 'address' is NULL.

SQL
SELECT * FROM contacts WHERE email [1] NULL AND phone [2] NULL AND address [3] NULL;
Drag options to blanks, or click blank then click option'
AIS
BIS NOT
C=
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or '!=' for NULL comparisons.
Using the wrong operator for NOT NULL checks.