Relational Algebra - Intersect operator (intersection)

Relational Algebra Between Sql And Query Plan

About

intersect (or intersection) is a relational operator that returns the intersection of two relation A and B, denoted by A ∩ B.

An intersection is defined as all tuples (rows) that are present in both of two union-compatible (same columns and same type) relation A and B.

The following definition are also equivalent.

  • all elements of A that also belong to B
  • all elements of B that also belong to A

Visualisation

Venn Diagram

Syntax

Minus

A derived operator using minus (-) where the minus expression <math>( R1 - R2 )</math> returns anything that is only in R1

<MATH>\Large R1 \cap R2 = R1 - ( R1 - R2 ) </MATH>

Join

  • Derived using join

<MATH> \Large R1 \cap R2 = R1 \times R2 </MATH>

Documentation / Reference





Discover More
Relational Algebra Between Sql And Query Plan
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...
Relational Algebra Between Sql And Query Plan
Relational Operator - Equi-joins

An Equi-join is a join where the condition (predicate) is an equality. theta join An equi-join links two relations (tables, ...) on common values in a column in relation 1 with a column in relation...
Data System Architecture
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...
Venn Diagram
Sql - Intersect

in SQL



Share this page:
Follow us:
Task Runner