โ Back to the prompt library
Coding
SQL Query Builder
Describe what you want, get working SQL.
The prompt
Write a SQL query for [DATABASE TYPE]. Tables: [DESCRIBE TABLES AND KEY COLUMNS]. I need: [WHAT YOU WANT, IN PLAIN ENGLISH]. Return: the query in a code block, a one-sentence explanation of the logic, and any index suggestion that would speed it up.
Run it in your AI: ChatGPT ยท Claude ยท Perplexity
Fill in these parts
[DATABASE TYPE][DESCRIBE TABLES AND KEY COLUMNS][WHAT YOU WANT, IN PLAIN ENGLISH]
How to use it
Replace every [BRACKETED] part with your own details, then paste the result into ChatGPT, Claude, Gemini, or any AI chat tool โ or run it right on WantPrompt with the built-in free AI. The more specific your replacements, the better the answer.
Embed this prompt on your site
Related prompts
- Code Explainer โ Understand any code, no matter how cryptic.
- Bug Hunter โ A second pair of eyes on your broken code.
- Regex Wizard โ Regular expressions without the headache.
Want 99 more like this? The full library is free, no signup.
Browse all 100 prompts โ