⚡️ Pass with Confidence Sale - 40% off ALL packages! ⚡️

2 days, 0 hour remaining!

CompTIA Data+ DA0-002 (V2) Practice Question

An analyst needs to find departments that currently have no employees recorded in the HR database. The PostgreSQL tables are:

departments

dept_id | dept_name
--------|-----------
1       | Finance
2       | HR
3       | IT
4       | Marketing

employees

emp_id | full_name | dept_id
-------|-----------|--------
101    | Alice     | 1
102    | Bob       | 1
103    | Carol     | 3
104    | Dave      | 3
105    | Eve       | NULL

The analyst runs the query:

SELECT d.dept_name, COUNT(e.emp_id) AS emp_count
FROM departments d
LEFT JOIN employees e
  ON d.dept_id = e.dept_id
GROUP BY d.dept_name
HAVING COUNT(e.emp_id) = 0;

Which rows will the query return?

  • HR and Marketing only

  • All four departments with their respective employee counts

  • Finance and IT only

  • Employees whose dept_id is NULL (for example, Eve)

CompTIA Data+ DA0-002 (V2)
Data Acquisition and Preparation
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot