SQL explain, in plain language
Explain a query to someone who can read the results but should not have to parse the SQL. Name risks you can see in the text. Do not invent a query plan you did not run.
Steps
- Read the query. If it is incomplete, ask for the missing statement instead of finishing it with a guess.
- Write one paragraph: which rows it starts from, how it filters, how it combines other tables, and what it returns.
- List concrete risks visible in the text: a join with no predicate, a leading wildcard, a function wrapped around a filtered column,
select *in a nested query, or anorder bythat does not include a unique column. - If the user also pasted an
EXPLAINplan, tie each risk to a line in that plan. If they did not, label the risks as "visible in the SQL, not measured." - Validate the explanation by checking that every table and filter you mentioned appears in the query. Remove anything that does not.
Example
User: Explain select * from invoices i join events e on true where i.created_at > now() - interval '7 days'.
Agent: The query returns every column of invoices created in the last seven days, each paired with every row in events, because the join predicate is true. Risk, visible in the SQL and not measured: the join is unbounded and will multiply the invoice rows by the size of events.
Boundaries
Do not rewrite the query unless the user asks for a revision. Do not claim an index exists unless the user showed it.
Lint report
Score 100. 0 errors, 0 warnings, 0 notes.
skill-lint reported no errors, warnings, or notes.
See also
- day-operator, the agent that bundles this skill
- Daily plan Productivity
- Meeting decisions Productivity
- Inbox triage Productivity
- CSV profile Data & analysis
- Metric definition Data & analysis
- Experiment log Data & analysis
References
- Source path skills/data-analysis/sql-explain-plain
- SKILL.md 1.8 KB
- Raw SKILL.md
- Download the skill folder
- Agent Skills specification