prompt

SQL Query from Business Question

Convert a business question into a production-ready SQL query with optimized joins, filters, and aggregations.

Updated June 2026
The prompt
Convert this business question into a production-ready SQL query:

Question: {{business_question}}

Context:
- Database: {{database_name}}
- Key tables: {{table_names}}
- Time period: {{time_period}}
- Segment filter: {{segment_filter}}
- Target metric: {{metric_name}}

Provide the query, explain the join logic, and flag any assumptions about data schema or grain.
Did it work? Rate this prompt

Variables

Business question
Database name
Key tables
Time period
Segment filter
Target metric

Details

Author

AI Khazna

License

Security

Type

prompt

Related assets

More curated picks in Data & Analytics.

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Data & Analytics