4-Relation Algebra Extended
4-Relation Algebra Extended
RELATIONAL ALGEBRA
(EXTENDED)
02 SEPTEMBER 2020
EXTENDED RELATIONAL-ALGEBRA-OPERATIONS
Generalized Projection
Aggregate Functions
Outer Join
GENERALIZED PROJECTION
Extends the projection operation by allowing arithmetic functions to be used in the
projection list.
G1,G2 ,,Gn
F ( A ),F ( A ,,F ( A ) (E )
1 1 2 2 n n
A B C
7
7
3
10
27
AGGREGATE OPERATION – EXAMPLE
Relation account grouped by branch-name:
branch_name sum(balance)
Perryridge 1300
Brighton 1500
Redwood 700
AGGREGATE FUNCTIONS (CONT.)
Result of aggregation does not have a name
Can use rename operation to give it a name
For convenience, we permit renaming as part of aggregate operation
Relation borrower
customer_name loan_number
Jones L-170
Smith L-230
Hayes L-155
OUTER JOIN – EXAMPLE
Join
loan borrower
Delete
Insert
Update
Update
r F1,F2 ,,Fl , (r )