← Prompting Templates

SQL Query Helper

Get correct SQL with an explanation.

# SQL Query Helper

**Prompt**

> Given this schema: [paste tables and columns], write a SQL query for [goal]. Use [database]. Explain each clause briefly and note performance risks.

**Fill in**

- Schema
- Goal
- Database

**Tips**

- Provide sample rows
- Ask for an index suggestion