Every T-SQL pattern, runnable in your browser
A practical T-SQL (SQL Server) reference for the clauses, joins, window functions, and edge cases that break production queries. Most examples run live in your browser; the syntax that’s genuinely SQL-Server-only is called out clearly where it can’t. An AI assistant is grounded in every page.
This runs real SQLite — edit it
Loading editor…
Everything in one place
Reference, runnable examples, an AI assistant, and a diagnostic tool for the query that won’t cooperate.
Reference
Core clauses, functions, joins, and window functions — each with the edge cases that break production queries.
Tutorials
Guided paths through the reference, in order — fundamentals, window functions, writing data, and troubleshooting.
Recipes
Copy-paste solutions to the problems people actually hit: top-N per group, dedup, pivot, gaps and islands.
Playground
A full SQL editor running real SQLite in your browser, against a seeded database. No signup.
Query Doctor
Paste a broken query and its error. Get the root cause, a corrected query, and how to avoid it next time.
Writing & transactions
INSERT, UPDATE, DELETE — plus BEGIN/COMMIT/ROLLBACK and isolation levels for changes that must not half-apply.
Performance
What an index actually does, the patterns that silently defeat one, and how to read a query plan on any engine.
Dialect comparison
The same ~16 operations side by side across PostgreSQL, MySQL, SQL Server, and SQLite.
Cheat sheet
Every clause, join, and function on one page — syntax and a one-line reminder, nothing else.
Type precedence checker
Pick two T-SQL types and see which one wins — straight from Microsoft's own table, with the index-killing cases flagged.
Execution plan explainer
Paste a plan’s XML and get Key Lookups, Spools, and missing-index suggestions flagged in plain English, right in your browser.
Runnable, not just described
Every example executes against a real database, right on the page. Edit it, run it, break it.
AI that's grounded
The assistant answers from these exact docs and links the page it used — not a guess from training data.
Edge cases first
The gotcha that makes the query wrong in production is the point of the page, not a footnote at the bottom.
From the blog
All postsNovember 7, 2026
Columnstore indexes: when row-by-row is the wrong question
Every index covered elsewhere on this site stores data row by row, because that's the right layout for finding a handful of specific rows fast. A columnstore index stores the same table column by column instead — wrong for that job, and dramatically right for a different one.
November 7, 2026
Computed columns and PERSISTED: indexing a column that isn't really there
A computed column is just an expression with a name — until PERSISTED makes it real storage, which is the one thing that turns "convenient" into "indexable."
November 7, 2026
Filtered indexes: the index that's smaller than your WHERE clause
Most indexes cover every row in the table whether a query needs them or not. A filtered index only covers the rows that match a condition you choose — smaller, faster to maintain, and often a better fit than the composite index it replaces.
Start with the clause that’s biting you
Or open the playground and paste the query you’re stuck on.