The Advanced Transact-SQL Querying, Programming and Tuning course is designed for professionals who want to strengthen their advanced T-SQL querying, programming, and performance tuning capabilities.
The programme focuses on developing efficient and scalable solutions using T-SQL across SQL Server 2014, 2016, 2017, 2019, 2022, and Azure SQL Database.
Participants learn not only how to write complex queries, but also how SQL Server processes those queries internally and how different design decisions can influence performance.
The course covers advanced areas including Logical Query Processing, Query Tuning, Subqueries, Table Expressions, Recursive Queries, the APPLY operator, Joins, Set Operators, Aggregation, Pivoting, Window Functions, Data Modification, Date and Time handling, Programmable Objects, Transactions, Concurrency, Dynamic SQL, and In-Memory OLTP.
Query performance is a major theme throughout the programme. Learners examine execution plans, indexing strategies, cardinality estimation, Query Store, temporary tables, plan reuse, and different methods for improving poorly performing queries.
Core Areas Covered
The programme explores:
- Logical Query Processing
- Query Tuning
- SQL Server internal structures
- Index tuning
- Columnstore indexes
- Query Store
- New Cardinality Estimator
- Temporary tables
- Sets versus cursors
- Query tuning through query revisions
- Derived tables
- Common Table Expressions
- Views
- Inline Table-Valued Functions
- Recursive queries
- APPLY operator
- Joins
- Set operators
- Aggregations
- Pivoting and unpivoting
- Window functions
- Ranking functions
- Offset functions
- Custom aggregates
- STRING_AGG
- TOP
- OFFSET-FETCH
- Data modification
- Date and time processing
- System-versioned temporal tables
- Dynamic SQL
- User Defined Functions
- Stored Procedures
- Triggers
- Transactions
- Concurrency
- Exception handling
- In-Memory OLTP
Practical Querying and Programming Problems
Throughout the course, participants use T-SQL to solve practical business and data-processing problems.
Examples include:
- Relational Division
- Missing and Existing Ranges
- Gaps and Islands
- Separating Elements
- Pivoting and Unpivoting
- Ranking
- Offset calculations
- Running Totals
- Moving Averages
- Year-to-Date calculations
- Custom Aggregations
- TOP and OFFSET-FETCH problems
- Paging
- Top N Per Group
- Median calculation
- Data De-Duplication
- Sequence handling
- Merging data
- Temporal interval processing
- Interval intersections
- Maximum concurrent intervals
- Interval packing
- Dynamic search conditions
- Dynamic filtering
- Migrating on-disk data to memory-optimized structures
Query Tuning and Performance Optimisation
A dedicated section of the course focuses on query tuning and SQL Server internals.
Topics include:
- Internal SQL Server structures
- Index access methods
- Index tuning
- Columnstore data
- Cardinality estimation
- Legacy and new cardinality estimators
- Query Store
- Temporary tables
- Set-based versus cursor-based solutions
- Query revisions
- Execution plan analysis
- Compilation and recompilation
- Plan caching
- Plan reuse
Query tuning is also integrated into the rest of the programme rather than treated as a completely separate topic.
For each querying and programming task, participants compare:
- Logical correctness
- Set-based approaches
- Iterative or procedural approaches
- Execution plans
- Resource usage
- Performance implications
























