Common Table Expressions (CTEs), often simply called WITH clauses, are essentially just named subqueries. They are a fairly new feature of T-SQL; with CTEs, you can break a long query into smaller chunks, which makes it more readable. Unlike T-SQL subqueries, CTEs can be recursive, allowing the traversal of hierarchical models of enormous depth.

About the Common Table Expressions in T-SQL Course
This course will cover simple CTEs, nested CTEs, and recursive CTEs. You will learn how to manage your T-SQL queries with CTEs, how and when to nest CTEs, and how to use recursive CTEs to move through hierarchical data models.

This course is intended for intermediate users. We assume the user knows the basics of T-SQL, including:

  • How to select from a single table, including writing complex WHERE conditions
  • How to JOIN tables
  • How GROUP BY and HAVING work
  • How T-SQL subqueries work

What Are the Requirements?

  • A web browser
  • Knowledge of basic SQL, including JOINs and GROUP BY clauses

What Am I Going To Get from This T-SQL Course?

You will discover how to:
  • Understand and use basic Common Table Expressions
  • Split long T-SQL queries with simple and nested CTEs
  • Deploy recursive CTEs
  • Write recursive CTEs that traverse a hierarchical data model

Who Should Take This Course?

  • Beginning database analysts
  • Developers who want to keep their knowledge of T-SQL current
  • Students taking classes in relational databases
  • Anyone who wants to learn Common Table Expressions in T-SQL
    Start for free
    Gift this course

    Bundle deals


    Reg. price

    MS SQL Server Kit

    Includes 5 courses Recursive Queries in MS SQL Server, GROUP BY extensions in MS SQL Server, Window Functions in MS SQL Server, SQL Basics in MS SQL Server, Common Functions in MS SQL Server

    Bundle price $99

    Table of contents

    Progress: 0% completed 0 of 112 exercises done

    1. Intro Quiz

    Test your knowledge of T-SQL

    More details Less
    Start now

    0% completed 0 of 10 exercises done

    2. CTE syntax

    Your first encounter with Common Table Expressions

    More details Less
    Start now

    0% completed 0 of 17 exercises done

    3. Nested CTEs

    You'll learn how to use nested CTEs

    More details Less
    Start now

    0% completed 0 of 15 exercises done

    4. Recursive CTEs

    You'll learn what recursion is and how to use it in T-SQL queries

    More details Less
    Start now

    0% completed 0 of 38 exercises done

    5. CTEs with INSERT, DELETE, and UPDATE

    You'll learn how to use INSERT, DELETE, and UPDATE statements with CTEs

    More details Less
    Start now

    0% completed 0 of 18 exercises done

    6. Final Quiz

    Test your knowledge in this final quiz

    More details Less
    Start now

    0% completed 0 of 14 exercises done


    Average rating

    5/5100.0 (1)


    5 Stars 100%
    4 Stars 0%
    3 Stars 0%
    2 Stars 0%
    1 Stars 0%
      Load more reviews