Vidyalelo
MySQL · Q497

MySQL

Programming · MySQL · question 497

Q497

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
Answer
B.
Only those columns whose emp_id is not NULL
C.
No output
D.
None of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
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.