nerdexam
CompTIA

DA0-002 · Question #58

A data analyst needs to create a combined report that includes information from the following two tables: Which of the following query methods should the analyst use for this task?

The correct answer is C. Union. To combine information from two tables with identical column structures into a single report, the data analyst should use the UNION query method.

Data Acquisition and Preparation

Question

A data analyst needs to create a combined report that includes information from the following two tables:

Which of the following query methods should the analyst use for this task?

Options

  • AGroup
  • BJoin
  • CUnion
  • DNested

How the community answered

(44 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    91% (40)
  • D
    5% (2)

Why each option

To combine information from two tables with identical column structures into a single report, the data analyst should use the UNION query method.

AGroup

GROUP BY is used to aggregate data based on one or more columns, not to combine rows from different tables.

BJoin

JOIN is used to combine columns from two or more tables based on a related column between them, not to append rows of similarly structured tables.

CUnionCorrect

The UNION query method is used to combine the result sets of two or more SELECT statements into a single result set. It requires that each SELECT statement within the UNION has the same number of columns, and that the columns have compatible data types, which aligns with the given scenario of two tables having identical column structures.

DNested

A nested query (or subquery) is a query embedded within another query, used to filter or retrieve specific data, not directly to combine entire result sets from separate tables.

Concept tested: SQL UNION operation

Source: https://learn.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-union-transact-sql

Topics

#SQL#Data Combining#Union Operator#Query Methods

Community Discussion

No community discussion yet for this question.

Full DA0-002 Practice