Set operators work on whole result rows, so start each answer by writing the two queries separately and checking they return the same columns in the same order. Then decide:
- stack everything:
UNION ALL;
- stack and remove repeats:
UNION;
- what both have:
INTERSECT;
- what only the first has:
EXCEPT.
Remember that a single ORDER BY goes at the end, the column names come from the first query, and set operators treat NULLs as equal.