Enhance your skills with the CompTIA Data+ Certification Test. Engage with flashcards, tackle challenging multiple choice questions, complete with hints and explanations. Get yourself exam-ready now!

Multiple Choice

To resolve duplicates when counting employees earning $125,000 or more, which SQL construct should be used?

Counting employees who earn at least 125,000 while removing duplicates requires returning only unique employees before counting. The best way is to count distinct values of an employee identifier after applying the salary filter. For example, you would use something like SELECT COUNT(DISTINCT employee_id) FROM employees WHERE salary >= 125000. The DISTINCT ensures each employee is counted once, even if there are multiple records for the same person. If you used only a WHERE clause, you’d filter rows but wouldn’t remove duplicates. GROUP BY could summarize by a field, but it wouldn’t automatically yield a single total without additional logic and would still depend on how you group. COUNT by itself would count every row that meets the condition, including duplicates.

Counting employees who earn at least 125,000 while removing duplicates requires returning only unique employees before counting. The best way is to count distinct values of an employee identifier after applying the salary filter. For example, you would use something like SELECT COUNT(DISTINCT employee_id) FROM employees WHERE salary >= 125000. The DISTINCT ensures each employee is counted once, even if there are multiple records for the same person.

If you used only a WHERE clause, you’d filter rows but wouldn’t remove duplicates. GROUP BY could summarize by a field, but it wouldn’t automatically yield a single total without additional logic and would still depend on how you group. COUNT by itself would count every row that meets the condition, including duplicates.