Semidifference and NOT - SQL
In this section first describe the relational difference operator, named MINUS. Example here shows SQL's closest counterpart of that operator.
Example: Difference in SQL
SELECT StudentId
FROM IS_CALLED
WHERE Name = 'Devinder'
EXCEPT DISTINCT CORRESPONDING
SELECT StudentId
FROM IS_ENROLLED_ON
WHERE CourseId = 'C1'
The syntax for EXCEPT exactly parallels that for UNION. The key words DISTINCT, ALL, and CORRESPONDING have exactly the same significance as in UNION, and DISTINCT remains the default option. When CORRESPONDING is not given, columns are paired by ordinal position, as in UNION.