Search code examples
selectionprojection

Should this be selection or projection


I have am learning relational algebra. I have a table,

Staff(name,salary,position)

Now a question states,

List all the managers with salary >25,000

Now the correct answer is,

selection position = manager ^ salary >25000(staff)

But I was thinking that it was,

projection position = manager ^ salary >25000(staff)

As we are selecting a particular attribute in the table and not selecting all the attributes. Please guide. Thanks


Solution

  • You want to "list all the managers", that means "select a number of rows".

    You are not "selecting a particular attribute", but you are filtering on a particular attribute (to select a row).

    Projection would be "list all the managers' names and salaries".

    In terms of SQL:

    • Selection is the WHERE clause

    • Projection is the list of columns in the SELECT clause