Back to prompts
Data AnalysisClaudeGPT-4

SQL query from natural language

Translates a plain-English question into a Postgres query.

Variables

Prompt(live preview)

Schema:
{{schema}}

Question: {{question}}

Write a single Postgres query that answers the question. Use CTEs if it improves readability. Include comments explaining any non-obvious joins or filters. After the query, briefly explain what it returns and call out any assumptions you made about the schema.

Comments

No comments yet. Be the first to share your experience with this prompt!

Sign in to leave a comment.