JJolix.
๐Ÿ“Š Data AnalysisNew this weekintermediate

Schema-Grounded SQL Generator (with Tests and Explanations)

Generate correct SQL from plain-English questions by grounding the model in your real schema โ€” with dialect awareness, assumptions, a query explanation, sanity checks and optional test data.

What it produces

Reference: Postgres MCP Pro (listed in awesome-mcp-servers) โ€” lets Claude inspect your schema and run the sanity checks in restricted read-only mode.Reference exampleยฉ Crystal DBA โ†—

The prompt

๐Ÿ”’

Unlock this prompt

~280 words, copy-paste ready. Pro members get this and every other prompt โ€” plus a new drop each week.

How to use it

  1. Paste the prompt with your real schema (e.g. from \d+ table in psql or your warehouse's information_schema).
  2. Run the sanity-check queries before trusting the numbers.
  3. In Claude Code with the Postgres MCP server (read-only mode), the agent can inspect the schema and run the checks itself.

More in Data Analysis