What is the output of this SQL query? SELECT COUNT(DISTINCT department_id) FROM employees;

16 views
  • Total number of employees
  • Total number of unique departments (Correct Answer)
  • Total number of NULL values in department_id
  • Total rows including duplicates

Explanation

COUNT(DISTINCT) counts only unique non-NULL values in department_id, giving the number of unique departments.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs