Introduction
Basic CTE
Summary
14. Summary

Instruction

Excellent. It's time to wrap things up.

  • The syntax for CTEs so far is as follows:
    WITH cte_name1 (cte1_columns) AS (your_cte1),
    cte_name2 (cte2_columns) AS (your_cte2),
    ...
    SELECT ...
  • CTEs are placed at the start of the query. They are introduced with WITH.
  • You can skip columns definition if you provide aliases to columns containing aggregates and other functions.
  • CTEs are temporary sets of rows similar to subqueries. Thanks to them, your query becomes better organized and easier to read.

Alright, then, shall we start with a very short quiz to check how much you remember?

Exercise

Press Next exercise to start the quiz.