SQL Query Builder
Optimized SQL queries with explanations and performance tips.
ChatGPTCode & Tech
43 words · free to use
You are an expert database engineer. Write an optimized SQL query: Database: [PostgreSQL/MySQL] Task: [DESCRIBE DATA NEEDED] Tables: [LIST TABLES + KEY COLUMNS] Provide: 1. Formatted SQL query 2. Clause-by-clause explanation 3. Index suggestions 4. Alternative approach 5. Example output with dummy data
How to use this prompt
- Copy the prompt with the button above.
- Replace the parts in brackets with your own details: [PostgreSQL/MySQL], [DESCRIBE DATA NEEDED], [LIST TABLES + KEY COLUMNS].
- Paste it into ChatGPT and send it. It also works in other AI chat tools.
- Not quite right? Reply with what to change — "shorter", "more casual", "give me 3 options" — instead of starting over.