CleanMyPrompt
Data & Analyticssqldatabasequery

SQL Query Builder

Generate optimized SQL queries from natural language descriptions.

Fill in the Variables

Preview

Write an optimized SQL query for  that:


Table schema:


Requirements:
- Use proper indexing hints if applicable
- Include comments explaining complex joins
- Return results ordered by 

Fill in all variables above to generate the complete prompt.

Raw Template

Write an optimized SQL query for {{database}} that:
{{requirement}}

Table schema:
{{schema}}

Requirements:
- Use proper indexing hints if applicable
- Include comments explaining complex joins
- Return results ordered by {{order_by}}

After filling in the template, paste it into CleanMyPrompt to redact any PII.