Prompt Library
Coding
SQL Query Builder
Schema in, question in — correct, explained SQL out.
The Prompt
Given this schema: [paste schema] Write a query that answers: [question] Then: (a) explain the query line by line, (b) note any index that would make it fast, (c) warn about edge cases like NULLs or duplicates that could skew the result.
Fill in before using
[schema][question]How to use it
- → Paste the prompt into your model of choice — it works with any frontier model.
- → Replace every bracketed placeholder with your specifics. Concrete inputs beat vague ones every time.
- → If the model asks a clarifying question, answer it — these prompts are designed to invite that.
- → Iterate on the output, not the prompt. The structure is already tuned.
SQLanalytics