Search code examples
databaseprojectionrelational-algebra

Projection in Relational Algebra


There is a table called Person which has name, age, weight columns.

name: a, b,c,d,e

age: 34,21,23,34,12

How can I use relational algebra to project the names that are ages 34?


Solution

  • If I remember relational algebra correctly it should be something like this:

    π name (σ age = 34 (Person)) 
    

    where π is projection and σ is selection. This would be equal to select name from Person where age = 34in SQL and can be read as from Person select relations where age is 34 and show name.

    The formatting options here are rather limited so it doesn't quite look like it should...