Professional Documents
Culture Documents
Person
id name year
1 P1 2010
2 P2 2019
3 P3 2020
Operations
Projection (∏) Selection of relationship attributes ∏email, username (User)
and removal of duplicate tuples:
∏name (Book)
Πattr1, . . . , attrn(R), де attr1..attrn –
attributes being selected, R – ∏title, comment (Post)
relation.
Example
id1 id2
1 2 1
Person
id name year
1 P1 2010
2 P2 2019
3 P3 2020
Operations
R⋈S
Operations
Intersection Selection of identical tuples of two Part in warehouse ∩
(∩) relations, compatible in number and
types of corresponding attributes Part in shop
(domains):
R ∩ S = R – (R – S)
Operations
Division (÷) For the relations R (A, B) and S (B)
returns such tuples from A that for
each b from B there is a tuple (a, b)
in R. If RXS = T, then T ÷ R = S and
T ÷ S = R.
Rules are:
1) T1=∏A (R);
2) T2=T1 X S;
3) T3= T2 – R;
4) T = T1 - ∏A (T3)
Division example
R S
S1 LR1 LR1
S2 KR1
Find students that have
S2 KR2 done all of the tests
Examples
The Relational Algebra examples are here