nerdexam
CompTIA

DA0-001 · Question #186

Which of the following statements would be used to append two tables that have the same number of columns?

The correct answer is A. UNION ALL. To combine the result sets of two tables that have the same number of columns into a single, appended result, the UNION ALL SQL statement is used.

Data Concepts and Environments

Question

Which of the following statements would be used to append two tables that have the same number of columns?

Options

  • AUNION ALL
  • BMERGE
  • CGROUP BY
  • DJOIN

How the community answered

(19 responses)
  • A
    89% (17)
  • B
    5% (1)
  • C
    5% (1)

Why each option

To combine the result sets of two tables that have the same number of columns into a single, appended result, the `UNION ALL` SQL statement is used.

AUNION ALLCorrect

The `UNION ALL` operator concatenates the result sets of two or more `SELECT` statements, including all duplicate rows, provided that the number of columns and their data types are compatible across all involved queries.

BMERGE

The `MERGE` statement in SQL is used for conditionally inserting, updating, or deleting rows in a target table based on matching or non-matching rows from a source, not for simply appending two tables.

CGROUP BY
DJOIN

Concept tested: SQL - UNION ALL operator

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

Topics

#SQL#Data Manipulation#Set Operators#Relational Databases

Community Discussion

No community discussion yet for this question.

Full DA0-001 Practice