0
0
SQLquery~10 mins

Why NULL is not a value 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 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'
A<>
B!=
C=
DIS
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' to compare with NULL, which always returns false.
2fill in blank
medium

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

SQL
SELECT * FROM employees WHERE salary [1] NULL;
Drag options to blanks, or click blank then click option'
A=
B<>
CIS NOT
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' or '<>' to check for NOT NULL, which does not work correctly.
3fill in blank
hard

Fix the error in the query to find rows where 'score' is NULL.

SQL
SELECT * FROM results WHERE score [1] NULL;
Drag options to blanks, or click blank then click option'
ALIKE
BIS
C=
DIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or 'LIKE' to compare with NULL.
4fill in blank
hard

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

SQL
SELECT * FROM orders WHERE date [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 '!=' to check for NULL or NOT NULL.
5fill in blank
hard

Fill all three blanks to select rows where 'price' is NULL, 'quantity' is NOT NULL, and 'discount' equals 0.

SQL
SELECT * FROM sales WHERE price [1] NULL AND quantity [2] NULL AND discount [3] 0;
Drag options to blanks, or click blank then click option'
AIS
BIS NOT
C=
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' to check for NULL or '!=' to check for NOT NULL.