# What an SQL query does — prompt for ChatGPT

Analyze an existing SELECT step by step to see where rows disappear, multiply or merge.

Canonical URL: https://boswidget.ru/en/what-an-sql-query-does-prompt-for-chatgpt/

Model: ChatGPT

Category: Code

Tags: SQL, explanation, JOIN

![What an SQL query does](https://boswidget.ru/assets/images/text-preview-cg-obyasnenie-sql-zaprosa-1200.64e3e26702f2.webp)

What an SQL query does

## Prompt

Explain this SELECT query: {query}. Database and schema: {schema}. Break down row sources, joins, filtering, grouping and result ordering. Use a small clearly fictional dataset to show how JOIN and NULL affect results. Separately identify what cannot be established without data and an execution plan. Do not claim execution or query speed. If field names disagree with the schema, flag the mismatches first.

## Template fields

- `{query}` — SQL query. Example input: Paste a read-only query with no secrets
- `{schema}` — DBMS and schema. Example input: SQL dialect, fields, types and table relationships

## Launch

[Open ChatGPT in YesAI](https://yesai.su/en/chatgpt)
