Relational algebra for:
Find Id Employeewhich one has taken training.
% :
r Γ· s , "all":
:
:
% : ", ".
:
Training ( TrainingCode , TrainingName, TrainingType, TrainingInstructor)
: TrainingCode:
TC = TrainingCode ()
employeeID trainingCode: .
ET = EmployeeId, TrainingCode ()
% Division, TrainingCode, , .
Result = EmployeeId (ET% TC)
" " - , .
6.3.4 DIVISION
DIVISION , universal quantification ALL. SQL . SQL EXISTS, CONTAINS NOT EXISTS .
DIVISION T(Y) = R(Z) %
S(X), X β Z Y = Z - X (, , Z =
X βͺ Y); Y - R, S, . X = {A}, Z = {A, B} then Y = {B}, B S.
T(Y) DIVISION , t, tuple tR R tR[Y] = t, tR[X] = tS every S. , . t, t DIVISION, t R S.
, { Ο , β , β , Ξ§ , - } Selection, Projection, Join, Cartesian Cross Minus ; . % β, β -:
T1 <-- βY(R)
T2 <-- βY((S Ξ§ T1) - R)
T3 <-- T1 - T2
, , R , S Y EmployeeId.
, .