Slideshow:
R ×Set S = S ×Set R R ×Bag S = S ×Bag R |
Examples:
Set A = {1,2} Set B = {3,4} A × B = (a,b) // First attr is from A, second attr is from B B × A = (b,a) // First attr is from B, second attr is from A A × B = {1,2} × {3,4} = {(1,3), (1,4), (2,3), (2,4)} B × A = {3,4} × {1,2} = {(1,3), (1,4), (2,3), (2,4)} // Note: after re-ordering to (a,b) !!! |
R ∪Set S = S ∪Set R R ∪Bag S = S ∪Bag R |
Examples:
Set A = {1,3} Set B = {3,4} A ∪Bag B = {1,3} ∪ {3,4} = {1,3,3,4} B ∪Bag A = {3,4} ∪ {1,3} = {3,4,1,3} |
R ∩Set S = S ∩Set R R ∩Bag S = S ∩Bag R |
Examples:
Set A = {1,3,3} Set B = {3,3,4} A ∩Bag B = {1,3,3} ∩ {3,3,4} = {3,3} B ∩Bag A = {3,3,4} ∩ {1,3,3} = {3,3} |
R ⋈Set S = S ⋈Set R R ⋈Bag S = S ⋈Bag R |
Examples:
Set A = {(a,1), (a,2), (b,3)} Set B = {(a,5), (b,7)} A ⋈ B = {(a,1), (a,2), (b,3)} ⋈ {(a,5), (b,7)} = {(a,1,a,5), (a,2,a,5), (b,3,b,7)} B ⋈ A = {(a,5), (b,7)} ⋈ {(a,1), (a,2), (b,3)} = {(a,5,a,1), (a,5,a,2), (b,7,b,3)} |
|