Let
X
| P |
Q |
R |
S |
T |
|---|
| 1 |
2 |
3 |
4 |
5 |
| 2 |
3 |
4 |
5 |
6 |
Y
| P |
Q |
U |
V |
|---|
| 1 |
2 |
3 |
4 |
| 2 |
4 |
5 |
6 |
| 3 |
4 |
5 |
6 |
X ⋈ Y
| P |
Q |
R |
S |
T |
U |
V |
|---|
| 1 |
2 |
3 |
4 |
5 |
3 |
4 |
So,
(i) will give {1}
(ii) will give {1, 2}
(iii) P{{<1, 2>, <2, 3> } - { {<1, 2>, <2, 3> } - {<1, 2>, <2, 4>, <3, 4> }}}
= P{1,2} = {1}
(iv) {1, 2} - {1, 2, 3} = {}
So, (i) and (iii) are the only possibility to be same. They are actually same because both are selecting tuples from the relation with same values for (P, Q) and then projecting the value for P.
(Note: Projection avoids duplicates unlike select in SQL)