Number sets

A∩B

SELECT *
FROM A
INNER JOIN B ON A.key = B.key

A∪B

SELECT *
FROM A
FULL JOIN B ON A.key = B.key

AΔB=(A∖B)∪(B∖A)

SELECT *
FROM A
FULL JOIN B ON A.key = B.key
WHERE A.key IS NULL
OR B.key IS NULL

A

SELECT *
FROM A
LEFT JOIN B ON A.key = B.key

A∖B

SELECT *
FROM A
LEFT JOIN B ON A.key = B.key
WHERE B.key IS NULL

B

SELECT * 
FROM A
RIGHT JOIN B ON A.key = B.key

B∖A

SELECT * 
FROM A
RIGHT JOIN B ON A.key = B.key
WHERE B.key IS NULL