0%

Relational Algebra

what is? SQL is not formal language, relational algebra is formal language of RDB

SQL is developed after RDB

An algebra in relation

what should in it?

what can input to algebra?

input a relation, output a relation

RA is procedural in nature,

a way to think to split query and most efficient

optimize the query in system

Key Relational Algebra Operators

unary: 一元的

Projection: which attribute we want to take out for the output

SELECT in SQL

Selection: select the tuple in this attribute when constraint is true

WHERE in SQL

Product: cross join

Join: matching rows on 2 relations

Set:

UNION, INTERSECT

Renaming: AS, rename the relation or attribute