Introduction
UNION
INTERSECT
EXCEPT
11. Summary

Instruction

You killed it, wonderful! In this part we have learned the following:

  • UNION and UNION ALL – combines results from two SELECTs. The first one emilinates the duplicates, while the other doesn't,
  • INTERSECT – returns all the rows present in both SELECT cluases,
  • EXCEPT – returns all the rows from the first SELECT clause, that aren't present in the second,
  • Remember that while using set operations, all the columns have to have the same data type.

Looks like we're done and you've mastered all there is to learn in this T-SQL basics course. By now, you should know how to:

  • Deal with single and multiple tables.
  • Filter results.
  • Compute statistics.
  • JOIN tables and results.
  • Perform set operations.

You can now write amazing queries all by yourself!

We've prepared a cumulative quiz to check your knowledge of all parts of this course. Give it a shot!

Exercise

Click Next exercise to finish this part.