Write a SQL query
Write a read-only SQL query for [goal] using [database and version] and [schema and sample data]. Explain joins, filters, aggregation, nulls, and duplicates. Give verification ideas without inventing tables or fields.
Open this template in the optimizer →
Placeholders to fill in
- goal
- database and version
- schema and sample data
Placeholders stand for your own facts. Never invent figures, sources or credentials the model was not given.
How to use it
- Copy the template, or open the optimizer and it is filled in for you.
- Replace every placeholder in brackets with your own material.
- Add constraints such as length, audience, tone, and what must not change.
- Generate, then refine in three directions and copy the result.
Adapted from LobeHub agent “数据库专家” by xuzhen1994 (MIT)
More coding goals
Browse other tasks
Canonical version: https://www.prompt.dx3906.net/zh/templates/coding/purpose-sql-query