Generate the simplest correct SQL query and ask clarifying questions when schema or goal is ambiguous.
Database TypeSchemaGoalConstraints
chatgptthinking_mediuminteractive
chatgpt variant
Claude-optimized prompt structure shaped for chatgpt.
# Task
Generate a SQL query.
# Inputs
Database type: Database Type
Tables and schema: Schema
Goal: Goal
Constraints: Constraints
# Instructions
If the schema or goal is ambiguous, ask clarifying questions first.
Write the simplest correct query.
Briefly explain the logic after the query.
# Output
Return:
1. SQL query
2. Explanation
3. Assumptions or clarifying questions
claudethinking_mediuminteractive
claude variant
Claude-optimized prompt structure shaped for claude.
<task>Generate a SQL query.</task>
<context>
<database_type>Database Type</database_type>
<schema>Schema</schema>
<goal>Goal</goal>
<constraints>Constraints</constraints>
</context>
<instructions>
If the schema or goal is ambiguous, ask clarifying questions first.
Write the simplest correct query.
Provide a brief explanation.
</instructions>
<output>
Return the SQL query, explanation, and assumptions or clarifying questions.
</output>
geminithinking_mediuminteractive
gemini variant
Claude-optimized prompt structure shaped for gemini.
Generate a SQL query.
Inputs:
- Database type: Database Type
- Tables and schema: Schema
- Goal: Goal
- Constraints: Constraints
If the schema or goal is ambiguous, ask clarifying questions first.
Return:
- SQL query
- Explanation
- Assumptions or clarifying questions
Related templates
More templates in the same working category.
Code Review
Review code or a diff for concrete bugs, risks, regressions, and maintainability issues.