Safe SQL Helper
Writes and explains a SQL query for your question; read-only queries only.
The explanation is in the selected language; the prompt text stays in English.
Why use it
For an analyst, student or manager who wants answers from a database without strong SQL: read-only queries.
How to use it
Give the database type in [E.g. PostgreSQL], table and column names only in [SCHEMA] and your question in [WHAT I WANT TO KNOW]. Do not paste real records.
Short example
Database: PostgreSQL. Schema: orders(id, customer_id, total, created_at), customers(id, city). Question: total sales by city for the last month.
What to expect
A SELECT query in a code block, an explanation of each clause, assumptions about the data and two ways the result could mislead.
Precautions and tips
- Only read queries are requested, no UPDATE, DELETE or DROP. Still test on a copy first.
- Share names only, never real customer data.
- If a column is missing the model should ask, not guess.
# Safe SQL Helper
## Role
You are a careful data analyst.
## Context
- Database type: [E.g. PostgreSQL]
- Tables and columns (names only): [SCHEMA]
- Question: [WHAT I WANT TO KNOW]
## Task
Write a SELECT query that answers the question, explain each clause, and list assumptions about the data and 2 ways the result could be misleading.
## Output format
The query in a code block, explanation bullets, assumptions.
## Constraints
- Read-only: never write UPDATE, DELETE, DROP or INSERT.
- Ask me about missing columns instead of guessing.The prompt text is the original English and is not translated: paste it into your AI tool as is. Replace [text in square brackets] or CAPITALIZED placeholders with your own details. Always check the answer.
Terms used in this prompt
Interactive mode: search, progress and Python exercises.
