Draft a complex query
If you ask
“Write a query to find users who signed up in the last 30 days but haven't made a purchase”
Then
Let AI draft complex queries with joins and CTEs that you can review and run.
Works in Claude, Codex, Cursor & any MCP agent
How this prompt works
-
Turn on the PostgreSQL connector in Claude, ChatGPT or Cursor — once.
-
Paste the prompt above. No code, no menus.
-
Let AI draft complex queries with joins and CTEs that you can review and run.
FAQ
How do I draft a complex query with PostgreSQL?
Add the PostgreSQL MCP connector once, then paste this prompt into Claude or ChatGPT: "Write a query to find users who signed up in the last 30 days but haven't made a purchase". Your AI runs it in PostgreSQL.
Do I need to code?
No. You install the connector once (a short config or one click), then ask in plain words. The prompt on this page works as-is.
Which AI assistants work?
Claude (Desktop, Code), Cursor, ChatGPT and other MCP clients. The same prompt works across them.
Set up PostgreSQL in Claude
Copy-paste config, setup steps and more ready-to-run prompts on the connector page.
Open PostgreSQL setupMore prompts