Task prompt · Coding

Write a SQL query from plain English

by Agent Yard Team

Describe what you need and get a correct, explained SQL query.

You'll attach

Text only

Works with

ChatGPTClaudeGeminiGrokCopilotGrok Bot

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.

How to use it

  1. Open chatgpt.com or claude.ai (or another AI listed here).
  2. 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.
  3. Copy the prompt, paste it into the chat and send.

Fill in the blanks (optional)

Prompt

Remix
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 best new prompts and personas, nothing else.

The Weekly is presented byyour brandSponsored · open

More Coding prompts

Footer partner · openThis strip runs at the foot of every page. One partner at a time.Ask about it →