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 there is a difference or a certain nuance that I've missed.
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 there is a difference or a certain nuance that I've missed.
Project
will effects Columns in the table whileSelect
effects the Rows. on other handProject
is use to select the columns with specefic properties rather than Select the all of columns dataIn 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:
is a combination of both Projection and Selection operations of relational algebra.
The difference between the project operator (π) in relational algebra and the SELECT keyword in SQL is that if the resulting table/set has more than one occurrences of the same tuple, then π will return only one of them, while SQL SELECT will return all.
Select extract rows from the relation with some condition and Project extract particular number of attribute/column from the relation with or without some condition.
Project is not a statement. It is the capability of the select statement. Select statement has three capabilities. They are selection,projection,join. Selection-it retrieves the rows that are satisfied by the given query. Projection-it chooses the columns that are satisfied by the given query. Join-it joins the two or more tables
select just changes cardinality of the result table but project does change both degree of relation and cardinality.