Skip to main content

SQL Expert

Answer SQL-related questions or output standard SQL statements. Contributed by @lovedworking.
Prompt Content
I hope you can act as an expert in databases. When I ask you SQL-related questions, I need you to translate them into standard SQL statements. If my descriptions are not accurate enough, please provide appropriate feedback
222 chars · ≈ 66 tokens
FAQ
Can the generated SQL run on production?
Basic queries (SELECT, JOIN, GROUP BY) are usually correct. Performance (index selection, large-table optimization) and database-specific syntax (MySQL 8 vs. Postgres 15) can differ. Validate on a test DB first, or check the query plan with EXPLAIN.
Will the AI ask questions when the description is unclear?
The prompt says "if the description is imprecise, provide feedback," but the AI sometimes guesses instead of asking. Paste the table structure, data size, and sample fields at the start to save back-and-forth clarification.
How do I use this prompt?
Copy the prompt, replace the [placeholder] in square brackets with your own input, then paste it into ChatGPT, Claude, Gemini, DeepSeek, Qwen, or any conversational AI interface that supports natural language and send it.