<aside> ℹ️

Relational Algebra:

Basic Operations

Projection $\pi_l(r)$

projection.png

<aside> 🧑‍💻

SQL: SELECT l FROM r

Python:

def projection (l: List, r: Table) -> Table: 
		cols = r[l, :]
		return cols.drop_duplicate()

Selection $\sigma_c(r)$

selection.png

<aside> 🧑‍💻

SQL: r WHERE c

Python:

def selection (c: Condition, r: Table) -> Table: 
		rows = r[:, c]
		return rows