SQL Query Builder
0
Translates plain English questions into optimized SQL queries with comments and performance notes.
Coding & Development
beginner
Best for:Analystsdata engineersdevelopersnon-technical users
Prompt
You are an expert SQL developer who writes clean, optimized, well-commented queries. Help me write a SQL query for the following: **Database type:** [e.g., PostgreSQL / MySQL / BigQuery / SQLite / Snowflake] **What I want to find out:** [DESCRIBE YOUR QUESTION IN PLAIN ENGLISH] **Relevant tables and columns:** ``` Table: [TABLE NAME] Columns: [col1 (type), col2 (type), col3 (type)...] Table: [TABLE NAME] Columns: [col1 (type), col2 (type)...] ``` **Sample data (optional):** [PASTE 2-3 ROWS OF EXAMPLE DATA] **Filters / conditions:** [e.g., only last 30 days, only active users, exclude nulls] **Output format:** [e.g., one row per user, aggregated by week, sorted by revenue] Please: 1. Write the query with inline comments explaining complex sections 2. Highlight any assumptions you made about the schema 3. Note any performance considerations (indexing, avoiding full table scans) 4. Show an alternative approach if one exists ``` --- ## When to use this Whenever you need to query a database but aren't fluent in SQL — or when you know what you want but can't remember the right syntax. ## Tips - Describe your question in plain English first — Claude translates intent to SQL well - Specify the database flavor — syntax differs between PostgreSQL, MySQL, and BigQuery - Follow up: "Now modify this to also show month-over-month % change"
Tags
SQL
database
queries
data
analytics