Divide
divide(R, S)
- Like join, there are common columns between R and S.
- Form "groups" in R, defined by unique values of the other
columns, (those that don't appear in S).
- Keep those groups that contain all of the S rows projected onto the common columns.
Example
R ÷ S computes values of X such that the corresponding set of Y contains
all of project(S, [Y]).
R
| X |
Y |
| 1 | aaa |
| 1 | bbb |
| 2 | aaa |
| 2 | bbb |
| 2 | ccc |
| 3 | bbb |
| 3 | ccc |
| 4 | aaa |
| 4 | bbb |
| 4 | ccc |
| 4 | ddd |
|
S
| Y |
Z |
| aaa | 10 |
| aaa | 20 |
| bbb | 30 |
| ccc | 40 |
|
|