Project Operation¶
Project¶
- The project operation eliminates some attributes from the returned query
- If \(A_1, A_2, ... A_n\) are attributes and \(r\) is the relation, then the operation is written as \(\Pi_{A_1, A_2, ... A_k}(r)\)
- This will also remove any rows that are now duplicates
Example¶
ID | name | dept_name | salary |
---|---|---|---|
222 | Hello | Physics | 165005 |
351 | World | Chemistry | 150406 |
SELECT ID, name FROM instructors
becomes
\(\(\Pi_{ID,\,name}(instructor)\)\)