A data analyst needs to create a combined report that includes information from the following two tables:
Managers table
ID
First_name
Last_name
Job_title
1001
John
Doe
Manager
1002
Jane
Roe
Director
Non-managers table
ID
First_name
Last_name
Job_title
1003
Robert
Roe
Business Analyst
1004
Jane
Doe
Sales Representative
1005
John
Roe
Operations Analyst
Which of the following query methods should the analyst use for this task?
Correct Answer: C
This question pertains to theData Acquisition and Preparationdomain, focusing on combining data from two tables. Both tables have the same structure (ID, First_name, Last_name, Job_title) and contain employee data, suggesting the task is to create a single list of all employees.
* Group (Option A): Grouping (e.g., GROUP BY in SQL) is for aggregation (e.g., counting employees by job title), not combining tables into a single report.
* Join (Option B): Joining tables (e.g., INNER JOIN) requires a common key and combines tables horizontally, but there's no indication of a relationship between the tables (e.g., no shared key beyond ID, which isn't linked).
* Union (Option C): UNION combines the rows of two tables with the same structure into a single result set, removing duplicates, which is ideal for creating a combined report of all employees from both tables.
* Nested (Option D): Nested queries (e.g., subqueries) are used for complex filtering, not for combining tables into a single list.
The DA0-002 Data Acquisition and Preparation domain includes "executing data manipulation," and UNION is the best method for combining two tables with identical structures into a single report.
Reference: CompTIA Data+ DA0-002 Draft Exam Objectives, Domain 2.0 Data Acquisition and Preparation.