On January 21th at 14:15 UTC , progression through exercises will be unavailable for 10 minutes due to a planned maintenance break.
Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Basic CTEs
14. Summary


Excellent. It's time to wrap things up.

  • The basic syntax for CTEs in SQL Server is:
    WITH CteName1 (Cte1Columns) AS (
    CteName2 (Cte2Columns) AS (
    SELECT ...
  • CTEs are placed at the start of the query. They are introduced with WITH.
  • You can skip column definitions if you provide aliases for columns containing aggregates and other function results.
  • CTEs are temporary sets of rows similar to subqueries. Thanks to them, your query becomes better organized and easier to read.

Shall we start a very short quiz to check how much you remember?


Click Next exercise to start the short quiz.