Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CompTIA DA0-002 Exam - Topic 1 Question 28 Discussion

Posted by Sheron on Oct 31, 2026 at 08:22 AM

A data analyst receives a request for the current employee head count and runs the following SQL statement:

SELECT COUNT(EMPLOYEE_ID) FROM JOBS

The returned head count is higher than expected because employees can have multiple jobs. Which of the following should return an accurate employee head count?

Suggested Answer: D

This question falls under the Data Analysis domain of CompTIA Data+ DA0-002, which involves using SQL queries to analyze data and address issues like duplicates in datasets. The issue here is that the initial query counts all instances of EMPLOYEE_ID in the JOBS table, but employees can have multiple jobs, leading to an inflated head count. The goal is to count unique employees.

SELECT JOB_TYPE, COUNT DISTINCT(EMPLOYEE_ID) FROM JOBS (Option A): This query is syntactically incorrect because COUNT DISTINCT(EMPLOYEE_ID) should use parentheses as COUNT(DISTINCT EMPLOYEE_ID). It also groups by JOB_TYPE, which is unnecessary for a total head count.

SELECT DISTINCT COUNT(EMPLOYEE_ID) FROM JOBS (Option B): This query is incorrect because DISTINCT applies to the rows returned, not the COUNT function directly. It doesn't address the duplicate EMPLOYEE_ID issue.

SELECT JOB_TYPE, COUNT(DISTINCT EMPLOYEE_ID) FROM JOBS (Option C): While this query correctly uses COUNT(DISTINCT EMPLOYEE_ID) to count unique employees, grouping by JOB_TYPE breaks the count into separate groups, which isn't required for a total head count.

SELECT COUNT(DISTINCT EMPLOYEE_ID) FROM JOBS (Option D): This query correctly counts only unique EMPLOYEE_IDs by using the DISTINCT keyword within the COUNT function, providing an accurate total head count without grouping.

The DA0-002 Data Analysis domain emphasizes 'given a scenario, applying the appropriate descriptive statistical methods using SQL queries,' which includes handling duplicates with functions like COUNT(DISTINCT). Option D is the most direct and accurate method for a total unique head count.


==============

Get Premium DA0-002 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
0 comments · newest first

Currently there are no comments in this discussion, be the first to comment!

0/2000 characters

Save Cancel