Informatics Practices

What is the correct statement for describing the UNION operation ?

  1. It combines the rows of any two different queries
  2. It combines the unique rows of two different queries which have the same set of attributes in the select clause
  3. It combines the rows of two different queries which have the same condition in the where clause
  4. It gives the Cartesian product of the results of any two queries

SQL Joins & Grouping

2 Likes

Answer

It combines the unique rows of two different queries which have the same set of attributes in the select clause

Reason — The UNION operation in SQL combines the results of two queries into a single result set, including only distinct rows from both queries. The queries must have the same number of columns having similar data types and order.

Answered By

1 Like


Related Questions