Data & SQL
The expensive mistakes in data work are rarely syntax errors. They are the join that silently doubled every row, the NULL that quietly dropped a fifth of the customers, and the number in a deck that nobody can reproduce six weeks later. These prompts are built around that: they ask for the failure mode before the answer, insist on a row-count sanity check, and require the model to state its assumptions about your schema rather than inventing columns and moving on. Several are deliberately run before you execute anything.
36 prompts in 5 groups
Data & SQL21 categories
Writing and reading queries
Drafting SQL from a plain question, making an inherited query legible, and moving it between dialects.
- Explain this query to me line by lineLongYou inherited a 200-line query and need to understand it before changing it.
- Write the query from a plain-language questionLongYou know exactly what you want to know and not how to express it in SQL.
- Solve this with a window functionLongYou're about to write a self-join and suspect there's a cleaner way.
- Port this query to another SQL dialectLongMoving a query between Postgres, BigQuery, Snowflake, MySQL, or SQLite.
- Build and explain a spreadsheet formulaLongWhen the lookup keeps returning N/A and the nesting is four deep.
- Explain this query in three sentencesShortSomeone handed you a query and you need the gist before you touch it.
- Rewrite this without nested subqueriesShortFour levels of nesting and nobody can read it, including you.
- A simpler version of this queryShortIt works, and it is longer than the problem deserves.
- Write this query, assumptions firstMediumYou know what you want to know and not how to say it in SQL.
- Port this query and tell me what shiftsMediumMoving a query between Postgres, BigQuery, Snowflake, MySQL, or SQLite.
Correctness checks
Catching the join that duplicates rows, the NULL that drops them, and the GROUP BY that lies.
- Check this query before I run itLongBefore running anything expensive, destructive, or going into a report.
- Find where this join is duplicating rowsLongYour totals are suspiciously round multiples of what they should be.
- Check my aggregation for grouping trapsLongAny query with GROUP BY that feeds a number someone will act on.
- Hunt every NULL trap in this queryLongWhen a count came back lower than expected and nothing looks wrong.
- Can any of these joins multiply rows?ShortTotals look inflated and you suspect the join before the data.
- Am I counting the right thing?ShortA count feeds a number someone will act on.
- Where could NULL change this result?ShortA count came back lower than expected and nothing looks wrong.
- Quick safety check on this queryMediumBefore running anything expensive, destructive, or going straight into a report.
- Audit the dates and timezones in this queryMediumNumbers are slightly off and the period boundary is the usual suspect.
- Is my GROUP BY lying to me?MediumAny aggregation that feeds a number somebody will act on.
Making queries faster
Diagnosing a slow query, reading the plan, and finding the smallest index that fixes it.
- Make this slow query fasterLongA query that used to be fine now takes minutes.
- What index should this query have?LongA query does a sequential scan and you want the smallest index that fixes it.
- Read this query plan with meLongYou have an EXPLAIN output and no idea which line is the problem.
- Why is this query slow?ShortA query got sluggish and you want one lead, not a checklist.
- Will this query use my index?ShortYou added an index and the plan still shows a sequential scan.
Schema and data quality
Designing tables, migrating them without breaking live code, and cleaning what you have been handed.
- Review this schema designLongBefore you create the tables everyone will depend on for years.
- Write data quality checks for this tableLongBefore you trust a table you've just been handed.
- Write a safe migration for this changeLongChanging a schema that live code is already reading and writing.
- Plan the cleanup of a messy columnLongFree-text data that half-works and needs to become reliable.
- Choose the shape for this report's dataLongDeciding between wide, long, or pre-aggregated before you build anything.
Numbers and metrics
Pinning down what a metric means, what a report measures, and whether a surprising number is real.
- Pin down this metric definitionLongTwo teams report different numbers for the same metric name.
- Work out what this report actually measuresLongInheriting a dashboard whose numbers nobody can explain.
- Sanity-check a number before I believe itLongA result jumped 40% and you want to rule out your own query first.
- What does this report actually measure?ShortInheriting a dashboard nobody can explain.
- Sanity-check this number before I share itShortA figure jumped and you want to rule out your own query first.
- Pin this metric downMediumTwo teams report different numbers under the same metric name.
Got one that isn't here?
Send a prompt you keep coming back to. A person reads every one.
Suggest a prompt