1 / 11
A 522-page practical guide to T-SQL on SQL Server: querying, joins, window functions, table design, transactions, stored procedures, error handling, indexes, execution plans, tuning, security, and deployment — every example run on SQL Server 2022.
From Your First Query to Stored Procedures, Performance Tuning, and Production
Read before you buy: the PDF here is a free sample — the first 20 pages of the 522-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.
Writing a first query takes minutes. Writing T-SQL that stays correct, fast, and safe takes understanding.
Behind countless business applications sits a SQL Server database, and the language that talks to it is Transact-SQL. This book takes you from the very first SELECT to the work professional database developers do every day: modifying data safely, writing stored procedures with proper error handling, designing indexes, reading execution plans, tuning queries, handling concurrency, securing data, and deploying database code like application code.
Every example runs against one realistic lab database — Copperpot Kitchens, a fictional group of three restaurants with menus, customers, staff, and orders — which you create with a script in Chapter 2. Every example in the book was run on SQL Server 2022, and the results you see are the results it produced.
- 522 pages · 28 chapters + 4 appendices
- Setup with SQL Server Developer or Express and SSMS, plus a complete lab database script
- SELECT, filtering, sorting, paging, data types, NULL logic, and built-in functions
- Joins, grouping with ROLLUP/CUBE/GROUPING SETS, subqueries, CTEs, and APPLY
- Window functions, set operators, PIVOT/UNPIVOT, and recursive CTEs
- Table design with keys and constraints; INSERT, UPDATE, DELETE, and MERGE with OUTPUT
- Transactions, isolation levels, locking, views, schemas, temporal tables, JSON, and XML
- Variables and control flow, stored procedures, user-defined functions, TRY...CATCH, triggers, and safe dynamic SQL
- Index design, execution plans, sargability, statistics, parameter sniffing, and Query Store
- Blocking, deadlocks, row versioning, security with row-level security, and backup and restore
- Database DevOps: source control, migrations, and testing with tSQLt
- A complete case study, a cheat sheet, templates, and a production checklist
Table Of Contents
Part I — Foundations
- Ch 1 · What T-SQL Is: SQL Server, Azure SQL, and the Tools
- Ch 2 · Setting Up: SQL Server Developer and Express, SSMS, and the Copperpot Lab Database
- Ch 3 · Querying Basics: SELECT, WHERE, ORDER BY, TOP, and OFFSET-FETCH
- Ch 4 · Data Types, NULLs, and Expressions
- Ch 5 · Built-in Functions: Strings, Dates, Conversion, and Logic
Part II — Querying in Depth
- Ch 6 · Joins: INNER, OUTER, CROSS, and Self Joins
- Ch 7 · Grouping and Aggregation: GROUP BY, HAVING, ROLLUP, CUBE, and GROUPING SETS
- Ch 8 · Subqueries, Derived Tables, CTEs, and APPLY
- Ch 9 · Window Functions: Ranking, Aggregates, Offsets, and Frames
- Ch 10 · Set Operators, PIVOT and UNPIVOT, and Recursive CTEs
Part III — Modifying Data and Designing Tables
- Ch 11 · Creating Tables: Data Types, Keys, Constraints, IDENTITY, and Sequences
- Ch 12 · INSERT, UPDATE, DELETE, and MERGE with the OUTPUT Clause
- Ch 13 · Transactions, Isolation Levels, and Locking
- Ch 14 · Views, Schemas, and Synonyms
- Ch 15 · Temporal Tables, JSON, and XML
Part IV — Programming T-SQL
- Ch 16 · Variables, Batches, and Control Flow
- Ch 17 · Stored Procedures
- Ch 18 · User-Defined Functions
- Ch 19 · Error Handling: TRY...CATCH, THROW, and XACT_ABORT
- Ch 20 · Triggers and Dynamic SQL
Part V — Performance
- Ch 21 · Indexes: Clustered, Nonclustered, Covering, Filtered, and Columnstore
- Ch 22 · Reading Execution Plans
- Ch 23 · Query Tuning: Sargability, Statistics, Parameter Sniffing, and Query Store
- Ch 24 · Concurrency in Practice: Blocking, Deadlocks, and Row Versioning
Part VI — Production and Case Study
- Ch 25 · Security: Logins, Users, Roles, Permissions, and Row-Level Security
- Ch 26 · Backup, Restore, and Maintenance for Developers
- Ch 27 · Database DevOps: Source Control, Migrations, and Testing with tSQLt
- Ch 28 · Case Study: Building the Copperpot Kitchens Order Platform
Appendices
- App A · T-SQL Cheat Sheet
- App B · Function and Template Reference
- App C · Production Checklist
- App D · Glossary
WHO IT IS FOR
Beginners who want a complete path from first query to professional T-SQL, application developers who work with SQL Server, data and reporting analysts who want to master joins and window functions, and developers taking on database responsibilities such as performance, security, and deployments.
FORMAT
PDF (A4), 522 pages, English, clickable table of contents and PDF bookmarks. Examples run on SQL Server 2022 (Developer and Express editions), with Azure SQL notes. 1st Edition, 2026. Published by thenexbooks.
This book is independent and is not affiliated with or endorsed by Microsoft Corporation. Microsoft and SQL Server are trademarks of the Microsoft group of companies.
Book details
| Detail | |
|---|---|
| Pages | 522 |
| Format | PDF (A4) |
| Language | English |
| Level | Beginner to Advanced |
| Edition | 1st Edition, 2026 |
| Download on this site | Free sample, first 20 pages (PDF) |
| Publisher | thenexbooks |
ไฟล์ที่คุณจะได้รับ
ยังไม่มีรีวิว เฉพาะผู้ซื้อเท่านั้นที่รีวิวได้
สินค้าอื่นจาก thenexbooks