// copy, run, move on

SQL snippets library

250 recipes for everyday database work: find the duplicate rows, see who is blocking whom, generate the DDL for the indexes you are missing. Each one gives you a statement you can run, a plain-language walkthrough and the variations people ask for next.

Data quality

Duplicates, orphans, gaps and the rows that break the rules. 50 recipes

Querying

Everyday SELECT work: ranking, diffing, paging and top-n per group. 54 recipes

Text & dates

Cleaning strings and doing arithmetic on dates and times. 45 recipes

模式

Tables, columns, constraints and the metadata to inspect them. 50 recipes

Indexes & performance

Finding missing indexes, unused ones and the queries that hurt. 14 recipes

Monitoring & admin

Blocking, sizes, sessions and the health of the instance. 37 recipes

// snippets are better with a schema brain

Run these with autocomplete that knows your tables

SQLly is a native SQL workbench for macOS, Windows and Linux. Paste a snippet into a live connection and you get schema-aware IntelliSense, a plan viewer and guards against unsafe edits.