How to use this prompt
- Pick your database type and list your tables and columns.
- Describe the result you want in plain English.
- Click Generate prompt, then Copy prompt or open it in ChatGPT, Claude, Gemini, Copilot, Perplexity, Grok or any AI app.
- Run the query on a test copy first, especially for updates or deletes.
SQL tips
- Run a SELECT with the same WHERE clause before any UPDATE or DELETE to see what will change.
- Paste CREATE TABLE statements for the most accurate queries.
- Do not understand an old query? Paste it into the Code Explainer.
- Working in spreadsheets instead? Try the Excel & Google Sheets Formula Helper.
Example: how to fill it in
Here is how a shop owner might fill in the form.
| Field | Example answer |
|---|---|
| Database type | PostgreSQL |
| Tables and columns | customers: id, name, email. orders: id, customer_id, total, created_at |
| What I need | Top 10 customers by total spend last month, with their email |
| Query type | Report with totals |
| SQL level | Beginner |
Common mistakes and how to fix them
- No table details. List tables and columns, or the AI has to guess names.
- Deleting without checking. Preview with a SELECT and back up first.
- Wrong database type. Syntax differs. Pick your exact database.
- Building SQL from strings. Use parameters in app code to prevent SQL injection.
Follow-up prompts to try
After the first result, keep the same chat open and send one of these:
- "Add a filter for orders over 100."
- "Turn this into a monthly report for the whole year."
- "Explain JOINs with this example."
- "Make this query faster on 10 million rows."
Frequently asked questions
Do I need to know SQL?
No. Describe what you need in plain English and it explains the query.
Which databases does it support?
PostgreSQL, MySQL, SQLite, SQL Server, BigQuery, Snowflake and Supabase.
Can it fix my query?
Yes. Paste it and choose Fix my query or Speed up my query.
Is it safe to run update queries?
Always preview, back up and test on a copy first.
