# Relational Algebra - Union operator

The union operation will takes two relations that are union-compatible (ie both relations have the same number of fields with the same types and returns all Tuples appearing in either relation (in Rel 1 or in Rel 2)

An union performed:

## Symbol

### Set

Set Union (no duplicate allowed - ie distinct) $$\begin{array}{c} \LARGE R_1 \cup R_2 \\ \end{array}$$

Sql equivalence: (union)

### Bag

Bag Union (duplicate allowed) $$\begin{array}{c} \LARGE R_1 \uplus R_2 \\ \end{array}$$

Sql equivalence: (union all)

## Example

Select the blue and red shirt $$\LARGE \sigma_{(color=Blue)} \text{Shirts} \cup \sigma_{(color=Red)} \text{Shirts}$$ where:

## Documentation / Reference

Discover More
Logical Data Modeling - Duplicate

A duplicate happens when in a set two elements have an equivalence relationship that returns true. In the set {1,1,2,3}, 1 is a duplicate The set {1,2,3} has no duplicate relational operators...
PowerCenter - Union Transformation

in Powercenter.
Relational Algebra - Expression and Operators

Relational algebra is based upon the fact that you can pass tabular data through a set of data operators (select, filter, join, sort, union, etc.) in a algebraic structure. It means that: the output...
SQL - Joins (Home)

in SQL. A join is a SQL clause statement which define the set operation such as: intersection, union, that the database must perform between two or more relation (table, view, query, ...). The...
Set Theory - Union

Set Theory - Union
Sql - Union

in SQL. Example in oracle: