Itzik — Ben-gan T-sql Fundamentals
You cannot hack your way through relational theory. You must understand it. Whether you are aiming for a promotion, a certification, or simply the respect of your peers, buying this book (or renting it via O’Reilly Online) and working through every single exercise is the highest-leverage activity you can do for your career in data.
You learn to read execution plans. Because you understand logical processing, you can look at a plan and immediately identify the bottleneck—whether it’s a missing index or a poorly written OR predicate. itzik ben-gan t-sql fundamentals
Itzik Ben-Gan’s Fundamentals is called that because it teaches the fundamental truths of relational theory , not because it is easy. An intermediate DBA who has been writing queries for five years will likely discover that they have been doing Outer Joins wrong or misunderstanding three-valued logic ( TRUE , FALSE , UNKNOWN ). Each chapter is filled with "Practice" questions. These are not simple "What is a SELECT statement?" questions. They are logic puzzles. For example: "Given a table with missing dates, write a query that returns the range of missing dates using a CTE and window functions." You cannot hack your way through relational theory