Show the result of a set difference between tables Q and R Assuming that we have two tables:

Table Q
D E
a 1
b 2
g 1


Table R
D E
f 1
b 2
h 3


Show the result of a set difference between tables Q and R. My answer is

D E
a 1
g 1


But my classmates said the instructor's answer is

D E
a 1
g 1
f 1
h 3


So it looks like symmetric difference rather than the real "difference", which answer is right? My classmates said that the question use the word "Between" so the answer should include two tables, but I do not think so.
Here is what you looking at (Set Difference)


Q - R
Set Q Minus Set R


In MySQL

SELECT Q.*
FROM Q LEFT JOIN R USING (D, E)
WHERE R.E IS NULL;


Here is what the classmates are saying (Symmetric Difference)


(Q - R) U (R - Q) or (Set Q Minus Set R) Union (Set R Minus Set Q)
Also (Set Q Union Set R) Minus (Set Q Intersection Set R)


In MySQL

SELECT A.* FROM
(SELECT Q.* FROM Q LEFT JOIN R
USING (D, E) WHERE R.E IS NULL) A
UNION
SELECT B.* FROM
(SELECT R.* FROM R LEFT JOIN Q
USING (D, E) WHERE Q.E IS NULL) B;


Please go ask Your Teacher !!!