What is the difference between Select and Project Operations

前端 未结 10 658
深忆病人
深忆病人 2020-12-23 20:42

I\'m referring to the basic relational algebra operators here.
As I see it, everything that can be done with project can be done with select.

I don\'t know if

10条回答
  •  独厮守ぢ
    2020-12-23 21:15

    In Relational algebra 'Selection' and 'Projection' are different operations, but the SQL SELECT combines these operations in a single statement.

    Select retrieves the tuples (rows) in a relation (table) for which the condition in 'predicate' section (WHERE clause) stands true.

    Project retrieves the attributes (columns) specified.

    The following SQL SELECT query:

    select field1,field2 from table1 where field1 = 'Value';
    

    is a combination of both Projection and Selection operations of relational algebra.

提交回复
热议问题