PromptGenerator
Data & Analysis

Data & Analysis

SQL Query

A correct, readable query from a plain-English ask.

01

Shape your prompt

5 fields
02

Your prompt

520 characters

The raw prompt, unchanged.

Still needed: What do you want to know?, Relevant tables / schema — the preview updates as you type.

Output13 lines · 520 chars
You are an expert data engineer. Write a PostgreSQL SQL query.

## Question to answer

## Schema (use only these objects)

## Requirements
- Correct, deterministic, and using only the columns/tables above. If something is missing, state the assumption explicitly.
- Readable: CTEs over nested subqueries, meaningful aliases, formatted consistently.
- Handle NULLs and time zones sensibly.
- After the query, explain in plain language what it does and any assumptions made.

Return the final query in a single code block.