Generalized Projection Operation, Aggregation Operation in Python
Let’s consider the following table and understand these operations with examples.
R1 : FACULTY-1
Generalized Projection Operation ( P ) :
This operation allows arithmetic operations or string operations in the attribute list of projection operations.
Example-1 : Find the list of FName having PhD degree and their 10 % of Salaries.
P FName, Salary ¸ 10 (sQual = ‘PhD’ (Faculty-1)
|FName||10% x Salary|
Aggregation Operation : ( )
Aggregate Function takes a collection of values and returns a single value as a result.
Example-2 : Find the sum of the salaries of all the faculty.
Output : 396000
Example-3 : Find the average of the salaries of all the faculty
Output : 39600