{"id":87623,"date":"2020-07-20T13:37:50","date_gmt":"2020-07-20T13:37:50","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=87623"},"modified":"2026-09-07T11:50:48","modified_gmt":"2026-09-07T11:50:48","slug":"learn-t-sql-free-guide-book-sql-server","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/learn-t-sql-free-guide-book-sql-server\/","title":{"rendered":"Learn T-SQL: a free guidebook to SQL Server programming"},"content":{"rendered":"\n<p><strong>If you&#8217;re new to SQL Server and want a clear, structured way into T-SQL, this free book by Gregory A. Larsen takes you from your first <code>SELECT<\/code> statement through joins, sorting, grouping, and the <code>INSERT<\/code>, <code>UPDATE<\/code>, and <code>DELETE<\/code> statements you&#8217;ll use every day. <\/strong><\/p>\n\n\n\n<p><strong>Written for beginners but thorough enough to fill in gaps for anyone who picked up T-SQL on the job rather than from a course.<\/strong><\/p>\n\n\n\n<div id=\"callout-block_2c9da547da5069ddaadcf873ff335760\" class=\"callout alignnone\">\n    <div class=\"child-last:mb-0 child-first:mt-0 bg-gray-50 dark:bg-gray-950 p-4xl my-3xl\">\n\n<p><strong>This book is still accurate in 2026<\/strong><\/p>\n\n\n\n<p>The T-SQL fundamentals in this book \u2014 <code>SELECT<\/code>, <code>JOIN<\/code>, <code>WHERE<\/code>, <code>GROUP BY<\/code>, <code>ORDER BY<\/code>, and the core <code>INSERT<\/code>\/<code>UPDATE<\/code>\/<code>DELETE<\/code> statements \u2014 work exactly the same way in SQL Server 2025 and Azure SQL as they did when this book was written.<\/p>\n\n<\/div>\n<\/div> \n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/assets.red-gate.com\/community\/books\/transact-sql-the-building-blocks-to-sql-server-programming.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"661\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/07\/transact-sql-the-building-blocks.png\" alt=\"Transact SQL The Building Blocks to Sql Server Programming eBook by Gregory A. Larsen\" class=\"wp-image-87624\"\/><\/a><\/figure>\n\n\n\n<p><b>Free eBook download (PDF):<\/b> <a href=\"https:\/\/assets.red-gate.com\/community\/books\/transact-sql-the-building-blocks-to-sql-server-programming.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Download here<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-s-covered-in-this-book\">What&#8217;s covered in this book?<\/h2>\n\n\n<div class=\"block-core-list\">\n<ul class=\"wp-block-list\">\n<li>The basic <code>SELECT<\/code> statement, and how to build a <code>WHERE <\/code>clause <br><br><\/li>\n\n\n\n<li>A short history of SQL and SQL Server, from IBM&#8217;s original research to today<br><br><\/li>\n\n\n\n<li>How to translate a relational model into real SQL Server tables, keys, and constraints<br><br><\/li>\n\n\n\n<li>Set theory made practical: <code>INTERSECT<\/code>, <code>UNION<\/code>, <code>EXCEPT<\/code>, and how they relate to joins<br><br><\/li>\n\n\n\n<li><code>INNER JOIN<\/code> and <code>OUTER JOIN<\/code>, explained with Venn diagrams and worked examples<br><br><\/li>\n\n\n\n<li>Sorting data with <code>ORDER BY<\/code>, including collation and case-sensitivity gotchas<br><br><\/li>\n\n\n\n<li>Logical operators: <code>BETWEEN<\/code>, <code>LIKE<\/code>, <code>IN<\/code>, and where each one trips people up<br><br><\/li>\n\n\n\n<li>Scalar functions, and the categories they fall into<br><br><\/li>\n\n\n\n<li>Summarizing data with <code>GROUP BY<\/code>, <code>ROLLUP<\/code>, <code>CUBE<\/code>, and <code>GROUPING SETS<\/code><br><br> <\/li>\n\n\n\n<li>Adding, changing, and deleting data with <code>INSERT<\/code>, <code>UPDATE<\/code>, and <code>DELETE<\/code><\/li>\n<\/ul>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-about-the-author\">About the author<\/h3>\n\n\n\n<p><strong>Greg Larsen<\/strong> has worked in the computer industry since 1980 and became a SQL Server DBA in 1999. He&#8217;s written hundreds of articles on SQL Server, spent years running a PASS user group and co-leading SQL Saturday events, and now teaches SQL Server as an adjunct professor. This book distills that hands-on teaching experience into a step-by-step introduction to T-SQL.<\/p>\n\n\n\n<p><a href=\"https:\/\/assets.red-gate.com\/community\/books\/transact-sql-the-building-blocks-to-sql-server-programming.pdf\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Click here to download the book (PDF) for free<\/strong><\/a><\/p>\n\n\n\n<div id=\"callout-block_2c9da547da5069ddaadcf873ff335760\" class=\"callout alignnone\">\n    <div class=\"child-last:mb-0 child-first:mt-0 bg-gray-50 dark:bg-gray-950 p-4xl my-3xl\">\n\n<p><strong>Additional resources<\/strong><\/p>\n\n\n\n<p>Once you&#8217;ve finished the book, return to Simple Talk for more T-SQL and SQL Server learning, including:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/t-sql-programming-sql-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">All T-SQL guides and articles on Simple Talk<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">All SQL Server guides and articles on Simple Talk<\/a><\/p>\n\n<\/div>\n<\/div> \n\n\n<section id=\"my-first-block-block_e83fef029db771ec97a2c58e112c208c\" class=\"my-first-block alignwide\">\n    <div class=\"bg-brand-600 text-base-white py-5xl px-4xl rounded-sm bg-gradient-to-r from-brand-600 to-brand-500 red\">\n        <div class=\"gap-4xl items-start md:items-center flex flex-col md:flex-row justify-between\">\n            <div class=\"flex-1 col-span-10 lg:col-span-7\">\n                <h3 class=\"mt-0 font-display mb-2 text-display-sm\">Fast, reliable and consistent SQL Server development&#8230;<\/h3>\n                <div class=\"child:last-of-type:mb-0\">\n                                            &#8230;with SQL Toolbelt Essentials. 10 ingeniously simple tools for accelerating development, reducing risk, and standardizing workflows.                                    <\/div>\n            <\/div>\n                                            <a href=\"https:\/\/www.red-gate.com\/products\/sql-toolbelt-essentials\/\" class=\"btn btn--secondary btn--lg\" aria-label=\"Learn more &amp; try for free: Fast, reliable and consistent SQL Server development...\">Learn more &amp; try for free<\/a>\n                    <\/div>\n    <\/div>\n<\/section>","protected":false},"excerpt":{"rendered":"<p>Free from Redgate: a beginner&#8217;s guide to T-SQL covering SELECT statements, joins, GROUP BY, and more. Download the PDF and start writing SQL Server queries. &hellip;<\/p>\n","protected":false},"author":78478,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9,143523,143525,159153,159158,143524,143531],"tags":[5120,4168,4170,4150,4151,4183,4745],"coauthors":[11330],"class_list":["post-87623","post","type-post","status-publish","format-standard","hentry","category-books","category-databases","category-learn","category-resources","category-simple-talk-published-books","category-sql-server","category-t-sql-programming-sql-server","tag-book","tag-database","tag-database-administration","tag-sql","tag-sql-server","tag-t-sql","tag-transact-sql"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/87623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/78478"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=87623"}],"version-history":[{"count":4,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/87623\/revisions"}],"predecessor-version":[{"id":112823,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/87623\/revisions\/112823"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=87623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=87623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=87623"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=87623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}