Professional Documents
Culture Documents
2021-2022
1
Lecture_3 Relational algebra
Data structure in an RDBMS
Keys
Relational algebra
Relational operators:
• select /sample/
• project
• cartesian /cross product/
• union
• intersection
• difference /subtraction/
• compound /left, right, full join/
• division
SQL operators: Right, Left, Full, Crosse Join.
• candidate;
✓One of the possible options /candidate/ is chosen to be the primary key based on its prevalence,
increasing use, etc.
✓Attribute, which is a candidate /possible key/, but not the primary, called alternative key.
6
Relational algebra
Relational operators:
• select /sample/
• project
• cartesian /cross product/
• union
• intersection
• difference /subtraction/
• compound /left, right, full join/
• division
0910 Anthony 26 М
0976 Sarah 28 Ж
students age
"Projection" retrieves the attributes or NAME
columns Jerry 20
Susan 23
Nancy 21
Anthony 26
Raimi 24
Sarah 28
composition
number students АВ
on the list NAME
0856 Nancy
0976 Susan
А В
list_ number students list _ number students
NAME NAME
0910 Anthony 0856 Nancy
0856 Nancy 0976 Susan
0910 Anthonхy
P1 Q1 R1
P1 Q1 Q1 R1
P2 Q2 R2
Р2 Q2 Q2 R2
P3 Q3 R3
Р3 Q3 Q3 R3
"Division" of relations
20