Free eBook: Learn T-SQL Querying

Learn T-SQL Querying
Troubleshoot query performance issues, identify anti-patterns in code, and write efficient T-SQL queries

Pedro Lopes and Pam Lahoud, 484 pages, May 2019

Key Features

  • Discover T-SQL functionalities and services that help you interact with relational databases
  • Understand the roles, tasks, and responsibilities of a T-SQL developer
  • Explore solutions for carrying out database querying tasks, database administration, and troubleshooting


T-SQL is an extension of the SQL language which allows you to tackle advanced querying and query-tuning challenges in SQL Server and Azure SQL Database. This book will be a perfect reference for you to write more efficient T-SQL code to perform simple-to-advanced tasks for data management and data analysis.

Register now to access this free eBook

Your password must have at least 8 characters, one uppercase, one lowercase and one number.

By signing up, you are confirming you would like to receive occasional emails about special offers and recommendations.


Chapter 1


Anatomy of a Query

Anatomy of a Query, shows you how to write solid, performant T-SQL. Users will become familiar with how SQL Server runs T-SQL syntax to deliver the intended result sets in a scalable fashion. In this chapter, we'll cover the basic building blocks that make up a T-SQL statement, as well as how SQL...

Chapter 2


Understanding Query Processing

Understanding Query Processing, introduces the fact that the way a T-SQL query is written and submitted to the server influences how it is interpreted and executed by SQL Server. Even before a single T-SQL query is written, the choice of development style (for example, using stored procedures ver...

Chapter 3


Mechanics of the Query Optimizer

Mechanics of the Query Optimizer, explores the internals of SQL Server query optimization and defines many important concepts that any database professional whowrites T-SQL queries will keep coming back to, especially when troubleshooting query performance issues. The Cardinality Estimator (CE) i...

Chapter 4


Exploring Query Execution Plans

Exploring Query Execution Plans, will leave the reader with a good understanding of the various elements that make up a query execution plan in SQL Server. Nearly everything we need to understand and troubleshoot the performance of our T-SQL queries can be found somewhere in the plan, either in t...

Chapter 5


Writing Elegant T-SQL Queries

Writing Elegant T-SQL Queries, will leave the reader with a better understanding of some of the aspects that database professionals need to keep in mind to write good queries, and how to identify some of the inefficiencies that may surface if the predicates expressed in queries are not supported...

Chapter 6


Easily-Identified T-SQL Anti-Patterns

Easily-Identified T-SQL Anti-Patterns, covers a few T-SQL anti-patterns, such as SELECT * syntax, OR logic, and functions in our predicates, that are relatively easy to find simply by looking at our T-SQL code and how it is written. The scenarios covered in this chapter are some of the most commo...

Related Titles

Professional Azure SQL Database Administration

Discover how you can migrate a traditional on-premise SQL server database to a cloud-based solution with Microsoft Azure. Built with database admin...

Introducing Microsoft SQL Server 2019

Explore the impressive storage and analytic tools available with the in-cloud and on-premises versions of Microsoft SQL Server 2019.

Professional Azure SQL Database Administration - Second Edition

Leverage the features of Azure SQL database and become an expert in data management

Discover the new Packt free eBook range