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
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.
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
The difference come in relational algebra where project affects columns and select affect rows. However in query syntax, select is the word. There is no such query as project. Assuming there is a table named users with hundreds of thousands of records (rows) and the table has 6 fields (userID, Fname,Lname,age,pword,salary). Lets say we want to restrict access to sensitive data (userID,pword and salary) and also restrict amount of data to be accessed. In mysql maria DB we create a view as follows ( Create view user1 as select Fname,Lname, age from users limit 100;) from our view we issue (select Fname from users1;) . This query is both a select and a project
Project
will effects Columns in the table while Select
effects the Rows. on other hand Project
is use to select the columns with specefic properties rather than Select the all of columns data