Set Operations
Next: Predicates & Joins
Up: Set Operations &
Previous: Set Operations &
-
SQL has the set operations union, intersect and minus.
Some examples:
-
Find all customers having an account at the SFU branch.

-
Find all customers having a loan at the SFU branch.

-
Find all customers having a loan, an account, or both at SFU
branch.

-
Find customers having a loan and an account at the branch.

-
Find customers having an account, but not a loan at the branch.

-
Some additional details:
- union eliminates duplicates, being a set operation.
- Not all implementations of SQL have these set operations.
- It is possible to express these queries using other operations.
Page created and maintained by Osmar R. Zaï ane
Last Update:
Mon Oct 16 16:41:58 PDT 1995