Part 3. Database development
Edited by Paul Nielsen
The simple SELECT statement is still the most complex and powerful single word in computer science. I’ve been writing database code professionally since the mid-1980s, and I’m still amazed at SELECT’s ability to draw in data from numerous sources (and types of sources) and make that data twist and shout, and present it exactly as needed.
The goal of Transact-SQL (T-SQL) is to provide the right question to SQL Server so the query optimizer can generate a query execution plan that’s correct and efficient. The code is only one part of the equation. The physical schema plays a huge role in the efficiency of the code and the query execution plan, and indexing is the bridge between the data and the query. Entering the schema + the query + the indexes into the query optimizer yields the query execution plan.
I might argue that the physical schema is the foundation for database performance; nulltheless, I can’t disagree that poor T-SQL code has been the source of many a database pain.
This section is where SQL Server MVPs who are passionate about their T-SQL code share their excitement for T-SQL—their passion, like mine, for making data twist and shout: