Câu 15: Cho các quan hệ:
X A B C Y C D E Z A E F
a2 b1 c1 c1 d1 e1 a1 e1 f1
a1 b2 c1 c1 d2 e2 a3 e1 f2
a2 b3 c2 c2 d3 e3 a3 e2 f3
Hãy thực hiện các phép toán đại số quan hệ sau:
b. DEF(YZ) c. AD(C=c1(XY))
Assistant
To solve these relational algebra operations, let's perform each step carefully.
Given relations:
Relation X(A, B, C):
A B C
a2 b1 c1
a1 b2 c1
a2 b3 c2
Relation Y(C, D, E):
C D E
c1 d1 e1
c1 d2 e2
c2 d3 e3
Relation Z(A, E, F):
A E F
a1 e1 f1
a3 e1 f2
a3 e2 f3
b. Compute: π_D E F (Y ⋈ Z)
Step 1: Find the natural join Y ⋈ Z
The common attribute between Y and Z is E. We'll match tuples from Y and Z where E values are equal.
Performing the natural join:
Match Y row (c1, d1, e1) with Z rows where E = e1: