• 42 prompts
  • 9 editor’s picks

Browse by format

  • Agents

    4
    System prompts and instructions that turn a chat assistant into a focused specialist or a reusable workflow.
  • Audio

    2
    Audio prompts for songs, sound design and voice direction in Suno and ElevenLabs.
  • Code

    4
    Coding prompts for reviews, tests, refactors, debugging and documentation, for chat assistants and AI code editors.
  • Image

    18
    Image prompts for photorealism, illustration, product shots and design concepts. Works with Midjourney, GPT Image, Nano Banana, Flux and Ideogram.
  • Video

    5
    Video prompts that describe the shot, the motion and the camera, ready for Veo, Sora, Kling and Runway.
  • Writing

    9
    Writing prompts for copy, emails, articles, scripts and summaries, tuned for ChatGPT, Claude and Gemini.

Editor’s pick

Categories

Twelve categories, from portraits and product shots to code reviews and lesson plans. Each one opens a list you can filter.

All categories

Prompts for the model you use

AI models

Every prompt lists the models it works with. On a prompt page, “Open in” copies it and opens the tool.

All models

SQL query from plain English

Turns a plain-English question into a commented, read-only SQL query with its assumptions spelled out; change the dialect, schema and question.

Customise it

Added

The prompt4 details to fill in · 194 words

You are a careful data analyst who writes correct, readable SQL. Write a PostgreSQL query that answers this question: Which 10 customers spent the most in the last 90 days, and how many orders did each place? Schema (tables and columns): customers (id integer, name text, country text, created_at timestamp); orders (id integer, customer_id integer, status text, total_amount numeric, created_at timestamp) Notes on the data: only orders with the status paid count, amounts are in GBP and timestamps are stored in UTC. Steps: 1. Restate the question in one sentence and list your assumptions, such as how you handle duplicates, nulls, time zones and cancelled records. 2. Write the query using only the tables and columns in the schema, with clear aliases, CTEs for multi-step logic and a short comment above each step. 3. Explain in plain words what the query does, step by step. 4. Suggest one quick check that the result is right, such as a row count or a sample of rows. Do not invent tables or columns. If the schema lacks something the question needs, say what is missing instead of guessing. Keep the query read-only: no INSERT, UPDATE, DELETE or DROP.

Works with

, ,

Click a highlighted part to change it.

LevelBeginner
You getA commented SQL query
Best forAnalysts, marketers and SQL beginners

Make it yours

Pick an option or type your own. The preview updates as you go: copy it when it reads right, or open it straight in your AI tool.

Your version stays in this browser. Ctrl or ⌘ + Enter copies it.

Your details4 details to fill in
SQL dialect
Preview
You are a careful data analyst who writes correct, readable SQL. Write a PostgreSQL query that answers this question: Which 10 customers spent the most in the last 90 days, and how many orders did each place? Schema (tables and columns): customers (id integer, name text, country text, created_at timestamp); orders (id integer, customer_id integer, status text, total_amount numeric, created_at timestamp) Notes on the data: only orders with the status paid count, amounts are in GBP and timestamps are stored in UTC. Steps: 1. Restate the question in one sentence and list your assumptions, such as how you handle duplicates, nulls, time zones and cancelled records. 2. Write the query using only the tables and columns in the schema, with clear aliases, CTEs for multi-step logic and a short comment above each step. 3. Explain in plain words what the query does, step by step. 4. Suggest one quick check that the result is right, such as a row count or a sample of rows. Do not invent tables or columns. If the schema lacks something the question needs, say what is missing instead of guessing. Keep the query read-only: no INSERT, UPDATE, DELETE or DROP.

About this prompt

The hard part of SQL is rarely the syntax; it is the assumptions hidden in the question. This prompt makes the model state those assumptions, use only your real tables and explain the query back to you, so you can trust the result before you share it.

Why it works

  1. The real schema

    Exact table and column names let the model write a query that runs, instead of one built on guessed names.

  2. Assumptions first

    Stating how duplicates, nulls and dates are handled exposes the decisions that quietly change the answer.

  3. Readable structure

    CTEs and step comments make the query easy to check, reuse and hand to a colleague.

  4. Read-only and honest

    Banning invented columns and write statements keeps the query safe to run against real data.

Tips for better results

  • Paste table definitions only, never real customer rows. Column names and types are enough.
  • Run a new query on a sample first, for example with LIMIT 100, and sanity-check the numbers before you share them.
  • Put business rules in the notes, such as what counts as an active customer; the schema cannot tell the model that.
  • If a query is slow, follow up with “Explain how to make this faster and which index would help.”

Variations to try

  1. Monthly trend

    Write a PostgreSQL query showing monthly revenue and the number of paid orders for the last 12 months, including months with no orders as zero. Table: orders (id, customer_id, status, total_amount, created_at); only rows with the status paid count. Use generate_series for the months and a LEFT JOIN, comment each step and explain the query in plain words.

  2. Explain a query I inherited

    Explain the SQL query below in plain English for a product manager. Describe what each part does in order, what one row of the result represents, the assumptions it makes about the data and anything that looks like a bug or could give misleading numbers. Do not rewrite it unless I ask.

Questions

Will the query run first time?

It has the best chance when you paste the real schema and choose the right dialect. Always run it on a sample and check the numbers before you rely on them.

Is it safe to paste my database schema?

Table and column names are usually low risk, but check your company’s policy first. Never paste real customer records, passwords or connection strings.

Did this prompt work for you?

Quick copy

SQL query from plain English

Copies your version from the studio.

For prompt makers

Got a prompt that works every time?

Send it in. We review every submission by hand and credit you on the page when it goes live.