Prerequisite – Relational Algebra
Project operation selects (or chooses) certain attributes discarding other attributes. The Project operation is also known as vertical partitioning since it partitions the relation or table vertically discarding other columns or attributes.
where ‘A’ is the attribute list, it is the desired set of attributes from the attributes of relation(R),
symbol ‘π(pi)’ is used to denote the Project operator,
R is generally a relational algebra expression, which results in a relation.
Given a relation Faculty (Class, Dept, Position) with the following tuples:
1. Project Class and Dept from Faculty –
Here, we can observe that the degree (number of attributes) of resulting relation is 2, whereas the degree of Faculty relation is 3, So from this we can conclude that we may get a relation with varying degree on applying Project operation on a relation.
Hence, the degree of resulting relation is equal to the number of attribute in the attribute list ‘A’.
2. Project Position from Faculty –
Here, we can observe that all the duplicate tuples are removed from the relation in the resulting relation. This is called as Duplicate elimination.
3. Project Class from Faculty –
- The Project operation removes duplicate tuples.
- The Project operation is not commutative, that is :
πAttribute List 1(πAttribute List2(R)) != πAttribute List 2 (πAttribute List1(R))
- The following expression is valid only if Attribute List 1 is a subset of Attribute List 2.
πAttribute List 1(πAttribute List2(R))
Moreover, writing the above expression is as good as writing the expression below:
πAttribute List 1(πAttribute List2(R)) = πAttribute List 1 (R)
- The cardinality (number of tuples) of resulting relation from a Project operation is:
1 <= πA(R) <= |R|
- The degree (number of attributes) of resulting relation from a Project operation is equal to the number of attribute in the attribute list ‘A’.
- In SQL, SELECT DISTINCT query is exactly as same as PROJECT here.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- RENAME (ρ) Operation in Relational Algebra
- SELECT Operation in Relational Algebra
- Cartesian Product Operation in Relational Algebra
- Difference between Relational Algebra and Relational Calculus
- Extended Operators in Relational Algebra
- Query Optimization in Relational Algebra
- Set Theory Operations in Relational Algebra
- Basic Operators in Relational Algebra
- Introduction of Relational Algebra in DBMS
- How to solve Relational Algebra problems for GATE
- Difference between Tuple Relational Calculus (TRC) and Domain Relational Calculus (DRC)
- Properties of Relational Decomposition
- Relational Model in DBMS
- Anomalies in Relational Model
- Tuple Relational Calculus (TRC) in DBMS
- Domain Relational Calculus in DBMS
- Constraints on Relational database model
- Violation of constraints in relational database
- Difference between Relational database and NoSQL
- Introduction of Relational Model and Codd Rules in DBMS
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.