Coding
SQLCodingDatabaseSQL Query Generator and Explainer
Writes and explains SQL queries for any database type.
Prompt Template
Generate a SQL query to [DESCRIBE WHAT YOU WANT TO RETRIEVE OR DO]. The database uses [DATABASE TYPE — PostgreSQL/MySQL/SQLite]. Relevant tables and their key columns: [LIST TABLES AND COLUMNS]. Requirements: [ANY SPECIFIC REQUIREMENTS — filtering, ordering, joining, aggregating]. After writing the query, explain each clause in plain English so a non-developer could understand what it does. Then suggest one optimization if applicable.
How to use this prompt
- Copy the prompt template using the button above.
- Paste it into your preferred AI assistant (ChatGPT, Claude, Gemini, etc.).
- Replace all bracketed placeholders like
[TOPIC]with your specific details. - Send the prompt and refine the output as needed.
Advertisement