ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

If in Table "employee", a column "emp_id" consists of {1,2,2,3,3,5,6,7,8,8} then what will be the output on executing the following MySQL statement?
SELECT DISTINICT emp_id
FROM employee;

Answer & Solution
Correct Answer: Option B
This question is about how MySQL's DISTINCT keyword works.
Imagine you have a table called "employee" with a column named "emp_id". This column stores employee IDs. The table has these IDs: {1, 2, 2, 3, 3, 5, 6, 7, 8, 8}.

The SQL statement `SELECT DISTINCT emp_id FROM employee;` means you want to get a list of all the unique "emp_id" values from the table. This means it will remove any duplicate IDs.

So, the correct answer is Option B: {1,2,3,5,6,7,8} because this shows only the unique employee IDs, removing the duplicate entries.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.