Write a SQL Query From a Business Question
Translate a business question into a clean, commented SQL query against your schema.
§ The Prompt— ready to copy
sql-query-from-question.prompt
I have a [DATABASE TYPE: e.g. Postgres / MySQL / BigQuery] database with these tables: [PASTE SCHEMA OR TABLE DEFINITIONS] Write a SQL query to answer: '[BUSINESS QUESTION]'. Format the query for readability with line breaks and comments explaining each non-obvious clause. Note any assumptions you made about the schema or business logic.
Replace anything in [BRACKETS] with your specifics before sending.
Best For — Roles
Use For — Tasks
§ Related Entries
You may also need
№ 064data
Analyze a Dataset With Pandas Step-by-Step
Generate step-by-step Pandas EDA code covering nulls, outliers, and a business question.
For
claude·chatgpt
№ 066data
Write a Data Cleaning Script for Messy Data
Generate a step-by-step Pandas data cleaning script with issue detection and before/after summaries.
For
claude·chatgpt
№ 078data
Use SQL Window Functions for Advanced Analytics
Generate advanced SQL window function queries with explanations and performance notes.
For
claude·chatgpt
№ 029coding
Design a Normalized Database Schema
Design a fully normalized relational database schema with DDL, indexes, and design rationale.
For
claude·chatgpt