# Relational Algebra - Project operator (Projection)

The project operator is a relational operator that keeps:

• only a set of columns (in other words eliminates the others).
• or delete attributes not in the projection list

It chooses a subset of the columns in the table.

## Visualisation

select vs projection.

## Notation

$$\begin{array}{c} \LARGE \Pi_{A_1,\,A_2,\,\dots} (R) \\ \\ \LARGE \Pi_{col_1,\,col_2,\, \dots} (Table) \end{array}$$

## Type

### Set

A set projection is equivalent to a distinct because a set does not allow duplicate.

Sql equivalent:

select distinct col1 from table


### Bag

A bag projection has no distinct because it allows duplicate.

Sql equivalent:

select col1 from table


Discover More
Calcite - Projection relational operator

Projection relational operator in Calcite is a relational operator. name expressions using alias(expr, fieldName) equivalent to: builder.field create simple expressions that return the fields...
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...
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 - Select Operator (Selection) -

The select operator is a relational operator that select the rows of a relation. select vs project This can be read as: Keep rows that satisfy the condition c (ie predicate) Delete rows...
Relational Operator - Rename

Rename or (renaming) is a relational operator that rename: a relation or an attribute of the relation rename the attribute a from R to b as Rename the 4 attributes {A, B, A, C} resulting...
SQL - DISTINCT (or UNIQUE)

A distinct is a SQL clause that remove duplicate rows. The distinct operation is performed as a set projection in linear algebra.
SQL - Select

SELECT is a keyword of the SQL Language (specifically dml) that permits to read data from the database. A SELECT Statement is called a query. The select statement has three capabilities: projection...