MySQL Questions and Answers – Null: the Four Letter Word

This set of MySQL Multiple Choice Questions & Answers (MCQs) focuses on “Null: the Four Letter Word”.

1. What is the meaning of “NULL” in Mysql?
a) Not applicable
b) Value not yet known
c) Value undefined
d) All of the mentioned
View Answer

Answer: d
Explanation: None.

2. Is the following statement is true/false?
“An expression can be NULL, but can never equal to NULL”
a) True
b) False
View Answer

Answer: a
Explanation: None.

3. Is the following statement is true/false?
“Two NULL values are equal to each other”
a) True
b) False
View Answer

Answer: b
Explanation: None.
advertisement
advertisement

4. Which operator is used to check whether the expression is “NULL”?
a) IS NULL
b) NOT NULL
c) ON
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

5. Which operator is used to check the expression is not “NULL”?
a) IS NULL
b) NOT NULL
c) ON
d) None of the mentioned
View Answer

Answer: b
Explanation: None.

6. What will be the output of the following MySQL command?

SELECT *
FROM person
WHERE emp_id IS NULL;

a) Only those columns whose emp_id is NULL
b) Only those columns whose emp_id is not NULL
c) No output
d) None of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

7. What will be the output of the following MySQL command?

advertisement
SELECT * 
FROM person
WHERE emp_id IS NULL;

a) Only those columns whose emp_id is NULL
b) Only those columns whose emp_id is not NULL
c) No output
d) None of the mentioned
View Answer

Answer: b
Explanation: None.

8. What will be the output of the following MySQL command?

SELECT *
FROM person
WHERE emp_id = NULL;

a) Only those columns whose emp_id is NULL
b) Only those columns whose emp_id is not NULL
c) No output
d) None of the mentioned
View Answer

Answer: c
Explanation: An expression can never be equated to NULL that is why there will be no output.

9. What will be the output of the following MySQL command?

SELECT fname
FROM person
WHERE emp_id != 6;

a) Only those names whose emp_id is not equal to 6
b) Only those names whose emp_id is equal to 6
c) No output
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

10. What will be the output of the following MySQL command?

SELECT fname
FROM person
WHERE emp_id != 6 OR emp_id IS  NULL;

a) Only those names whose emp_id is not equal to 6 or emp_id with NULL values
b) Only those names whose emp_id is not equal to 6
c) Only those names whose emp_id is equal to 6
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.