?
What will be the output of the following MySQL command?
What will be the output of the following MySQL command?
SELECT *
FROM person
WHERE emp_id IS NULL;
SELECT *
FROM person
WHERE emp_id IS NULL;
Answer & Solution
Correct Answer:
Option
A
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.
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.
Join the Discussion
Login to post a comment or share your explanation.
Login