Examveda

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

Answer: Option A

Solution (By Examveda Team)

This question asks about how MySQL handles finding rows where a specific column has a NULL value. Let's break it down:
SELECT * FROM person: This part tells MySQL to fetch all columns (*) from a table named "person."
WHERE emp_id IS NULL: This part specifies a condition. It's looking for rows where the "emp_id" column has a NULL value.
NULL is a special value in databases, meaning "no value" or "unknown."
So, the correct answer is:
Option A: Only those columns whose emp_id is NULL
The command will only return rows where the "emp_id" column is NULL, meaning those rows where there is no employee ID present.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous