Home > Databases > Quizzes > MySQL Basics Practice Test: Null
MySQL Basics Practice Test: Null
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 80% Most missed: “What will be the output of the following MySQL command?”

In MySQL, the NULL value represents "no data" or "a missing unknown value". It is different from an empty string, which represents a value for string types, and 0, which represents a value for numeric types. NULL can be written in any lettercase, and for example, \N is a synonym for NULL. 

To test for NULL, you can use the IS NULL and IS NOT NULL operators. For example, you can use the following query: 
mysql> SELECT 1 IS NULL, 1 IS NOT NULL; 
 
You can't use arithmetic comparison operators like = or <. In MySQL, 0 or NULL means false and anything else means true. For example, if you run the query select null = null, you'll get null back as the result. 
To represent null values in your queries, you can use the ifnull statement. This statement checks if a value is null and replaces it with a specified value if it is. 

MySQL Basics Practice Test: Null
Time left 00:00
10 Questions

1. Which operator is used to check the expression is not “NULL”?
2. “Two NULL values are equal to each other”
3. What will be the output of the following MySQL command?
SELECT fname
FROM person
WHERE emp_id != 6 OR emp_id IS NULL;
4. What is the meaning of “NULL” in Mysql?
5. What will be the output of the following MySQL command?
SELECT *
FROM person
WHERE emp_id IS NULL;
6. “An expression can be NULL, but can never equal to NULL”
7. Which operator is used to check whether the expression is “NULL”?
8. What will be the output of the following MySQL command?
SELECT *
FROM person
WHERE emp_id = NULL;
9. What will be the output of the following MySQL command?
SELECT fname
FROM person
WHERE emp_id != 6;
10. What will be the output of the following MySQL command?
SELECT *
FROM person
WHERE emp_id IS NULL;