1 / 11
A 533-page, hands-on guide to Microsoft SQL Server. It takes you from your first T-SQL query to execution plans, indexing, Query Store, security, and backup and restore. Every example runs against one realistic sample database.
T-SQL, Performance Tuning, and Administration in Practice
Read before you buy: the PDF here is a free sample — the first 20 pages of the 533-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.
SQL Server runs a vast amount of the world's business software. Sooner or later, many developers become the person who is asked why the database is slow, how to change the schema safely, or whether the backups really restore.
This book takes you from your first T-SQL query to the skills you need to be trusted with a production database.
Every example runs against Bluewater Freight, a realistic sample database of a fictional European freight carrier. It has warehouses, 600 customers, 24,000 shipments, over 118,000 tracking events with JSON details, drivers, and invoices. The T-SQL was run on SQL Server 2022, and the results shown in the book were copied from that output. You can follow along on the free Express or Developer edition.
WHAT'S INSIDE
➔ 533 pages · 28 chapters in 6 parts + 4 appendices
➔ Sample database script included (Bluewater Freight)
➔ T-SQL from the basics: data types, joins, subqueries, grouping, PIVOT
➔ Window functions, CTEs, recursive queries, APPLY, MERGE and OUTPUT
➔ Views, stored procedures, functions, transactions, and TRY...CATCH
➔ JSON, temporal tables, ledger tables, triggers, auditing, and safe dynamic SQL
➔ Execution plans, indexing (including columnstore), statistics, and parameter sniffing
➔ Query Store, locking and deadlocks, DMVs, wait statistics, and Extended Events
➔ Security and row-level security, backup and restore, maintenance, and HA/DR
➔ Connecting applications from C#, Python, Node.js, and Java, plus a full case study
Table Of Contents
PART I — GETTING STARTED WITH SQL SERVER
- Ch 1 · SQL Server Today: Editions, Versions, Tools, and What We Will Build
- Ch 2 · Installing SQL Server and the Tools, and the Bluewater Freight Database
- Ch 3 · Databases, Schemas, Tables, and Data Types
- Ch 4 · Querying Basics: SELECT, WHERE, ORDER BY, TOP, and Built-In Functions
- Ch 5 · Joins, Subqueries, and Set Operators
PART II — T-SQL IN DEPTH
- Ch 6 · Grouping, Aggregation, GROUPING SETS, and PIVOT
- Ch 7 · Window Functions: Ranking, Running Totals, LAG/LEAD, and Analytics
- Ch 8 · Common Table Expressions, Recursive Queries, and APPLY
- Ch 9 · Modifying Data: INSERT, UPDATE, DELETE, MERGE, and OUTPUT
- Ch 10 · Views, Stored Procedures, and User-Defined Functions
- Ch 11 · Transactions and Error Handling: TRY...CATCH, THROW, and XACT_ABORT
PART III — DESIGN AND ADVANCED FEATURES
- Ch 12 · Database Design: Keys, Constraints, Normalization, and Data Integrity
- Ch 13 · Dates, Strings, and JSON in T-SQL
- Ch 14 · Temporal Tables, Sequences, Computed Columns, and Ledger Basics
- Ch 15 · Triggers, Change Tracking, Change Data Capture, and Auditing
- Ch 16 · Dynamic SQL Done Safely: sp_executesql, Parameters, and SQL Injection
PART IV — PERFORMANCE TUNING
- Ch 17 · How SQL Server Runs a Query: Execution Plans and Their Operators
- Ch 18 · Indexing: Clustered, Nonclustered, Covering, Filtered, and Columnstore
- Ch 19 · Statistics, Cardinality Estimation, and Parameter Sniffing
- Ch 20 · Query Store and Intelligent Query Processing
- Ch 21 · Concurrency: Locking, Blocking, Isolation Levels, and Deadlocks
- Ch 22 · Troubleshooting with DMVs, Wait Statistics, and Extended Events
PART V — ADMINISTRATION
- Ch 23 · Security: Logins, Users, Roles, Permissions, RLS, and Encryption
- Ch 24 · Backup, Restore, and Recovery Models
- Ch 25 · Maintenance and Automation
- Ch 26 · High Availability and Disaster Recovery
PART VI — SQL SERVER IN PRACTICE
- Ch 27 · Connecting Applications: Drivers, Pooling, ORMs, and Pagination
- Ch 28 · Case Study: Taking Bluewater Freight from Schema to Production
APPENDICES
- App A · T-SQL Cheat Sheet
- App B · DMV and System View Reference
- App C · Production Readiness Checklist
- App D · Glossary
WHO IT IS FOR
This book is for:
- Application developers who build on SQL Server.
- New and "accidental" DBAs.
- Developers coming from PostgreSQL, MySQL, or Oracle.
- Students preparing for database or backend roles.
No prior SQL Server experience is required.
FORMAT
PDF (A4), 533 pages, English, clickable table of contents and PDF bookmarks, plus the sample database script as a ZIP. 1st Edition, 2026. Published by thenexbooks. Not affiliated with or endorsed by Microsoft.
Book details
| Detail | |
|---|---|
| Pages | 533 |
| Format | PDF (A4) + sample database script (ZIP) |
| Language | English |
| Level | Beginner to Intermediate |
| Edition | 1st Edition, 2026 |
| Download on this site | Free sample, first 20 pages (PDF) |
| Publisher | thenexbooks |
Files you get
No reviews yet. Only buyers can review.
More from thenexbooks