Nothing is sent without a yes

Bot Cookbook

Search the index

Search templates, guides, and prompts.

Prompt

Write a SQL query: Grok Bot prompt

A SQL query with explanation.

Updated 15 Oct 2026.

We've tried this one (last run 14 Oct 2026).

Are you the creator? Ask us to remove this.

Prompt

Write a SQL query to [goal] from tables [describe tables]. Explain each part and note anything that could be slow.

Fill in

  • [goal]
  • [describe tables]

Connectors

none

Uses this feature

Chat and drafts · Chat and collaboration

When is “Write a SQL query” worth pasting into Grok Bot?

“Write a SQL query” gives the bot one job: “Write a SQL query to [goal] from tables [describe tables]. Explain each part and note anything that could be slow.”

How do I fill in the blanks in “Write a SQL query”?

Fill the blanks in “Write a SQL query”: where it says “a SQL query to [goal] from tables [describe tables]”, put the goal you mean and where it says “to [goal] from tables [describe tables]. Explain each”, put the describe tables you mean. Send it without [goal] and [describe tables] still sitting in the text.

What should “Write a SQL query” hand back?

Expect “Write a SQL query” to come back with “A SQL query with explanation.” Check the reply against the job you gave it: “Write a SQL query to [goal] from tables [describe tables]. Explain each part and note anything that could be slow.”

What usually goes wrong with “Write a SQL query”?

The miss with “Write a SQL query” is sending [goal] and [describe tables] through as if they were real values. Fill them so the reply can still match “A SQL query with explanation.”