Write advanced T-SQL code

Intermediate
Data Engineer
Database Administrator
Developer
Solution Architect
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Microsoft Fabric

Learn advanced T-SQL techniques including CTEs, window functions, JSON, regular expressions, fuzzy matching, graph queries, and error handling for SQL Server, Azure SQL, and Fabric.

Learning objectives

By the end of this module, you'll be able to:

  • Write Common Table Expressions (CTEs) including recursive CTEs for hierarchical data
  • Use window functions for ranking, aggregation, and analytical calculations
  • Parse, construct, and transform JSON data using JSON functions
  • Apply regular expressions for pattern matching and text manipulation
  • Find approximate matches using fuzzy string matching functions
  • Create and query graph data using the MATCH operator
  • Write correlated subqueries for row-by-row comparisons
  • Implement structured error handling with TRY...CATCH

Prerequisites

  • Experience writing T-SQL queries including SELECT, JOIN, WHERE, and GROUP BY clauses
  • Understanding of aggregate functions like SUM, COUNT, AVG, MIN, and MAX
  • Familiarity with SQL Server, Azure SQL Database, or SQL databases in Microsoft Fabric
  • A SQL Server 2019+ instance, Azure SQL Database, or Fabric SQL database to practice with