Task prompt · Coding
Write a SQL query from plain English
by Agent Yard TeamDescribe what you need and get a correct, explained SQL query.
Use cases
- Describe what you need and get a correct, explained SQL query.
- Reuse it as often as you like: fill in the blanks (postgres, mysql, sqlite or bigquery; question in plain english; table names with columns and types) with new details and copy again.
- With ChatGPT, Claude, Gemini and more, the AIs that support what this prompt needs.
Featured in: Best Claude prompts for coding, Best Claude prompts for essays and writing, Best ChatGPT prompts for SQL and databases.
How to use it
- Open chatgpt.com or claude.ai (or another AI listed here).
- Fill in the highlighted blanks ([POSTGRES, MYSQL, SQLITE OR BIGQUERY], [QUESTION IN PLAIN ENGLISH], [TABLE NAMES WITH COLUMNS AND TYPES]) below, or edit them after pasting.
- Copy the prompt, paste it into the chat and send.
Fill in the blanks (optional)
Prompt
Write a [POSTGRES, MYSQL, SQLITE OR BIGQUERY] query that answers: [QUESTION IN PLAIN ENGLISH]. My tables: [TABLE NAMES WITH COLUMNS AND TYPES]. Explain the query clause by clause, note assumptions about the data (nulls, duplicates, time zones), and suggest an index if it would be slow on a large table. Also give one query I can run to sanity-check the result.
One email a week
The Weekly is presented byyour brandSponsored · openThe best new prompts and personas, nothing else.