What is the difference between Select and Project Operations

前端 未结 10 699
深忆病人
深忆病人 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:22

    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

提交回复
热议问题