/  Technology   /   The Relational Algebra in Python
Datascience in car technology

 The Relational Algebra in Python

 

The relational algebra is a ‘procedural query language’. It consists of a set of operations that accept one or two relations as input and provide a new relation as the output.

 

The following are the types or set of operations in Relational Algebra :

 

  • Select (s): It selects tuples that satisfy a given predicate.
  • Project (P): It shows the list of those attributes that we wish to appear in the result.
  • Cross-Product (X): It combines each row in one table with each row in the other table.

      

  • Set-Union (U): Let there be two sets X and Y. The union operation contains all the tuples that are either in X or Y or both in X & Y.
  • Set-Intersection (Ç): Let there be two tuples X and Y. The set intersection operation contains all tuples that are in both X & Y.
  • Set-Difference (-): Let There be two tuples X and Y. The set intersection operation contains all tuples that are in X but not in Y.
  • Renames (ρ): It renames the output relation.              

Some other operations are :

  • Assignment (←)
  • Outer-Join ( ]X[ )           
  • G-Projection (P)
    • Aggregation ( )
  • Natural-Join (|X|)

 

Leave a comment