← Prompt Library / Engineering

Engineering

SQL From a Question

Turn a plain-English data question into a working SQL query — with the assumptions stated, a readable structure, and the index note that keeps it fast.

Write a SQL query to answer: "{{question}}".

Schema:
{{schema}}

Return: the query with a comment per clause explaining its role, the assumptions you made about my schema or data (stated so I can correct them), the dialect notes if syntax varies ({{dialect}}), one common trap for this query shape (NULL-eating joins, timezone drift on date grouping, accidental fan-out), and the index that would make it fast if the tables are large. Prefer readable CTEs over nested subqueries.

Fields like {{ this }} are placeholders — replace them with your own details, or let Aria ask you for them.

sql queries data

Run this prompt with your real data

This prompt runs with Aria connected to your email, files, CRM and 40+ other services — and you can schedule it to run automatically.

Start Free Week

More Engineering prompts

Pragmatic Code Reviewer

Review a diff for correctness, security, and readability issues.

Explain This Code

Get a plain-English walkthrough of unfamiliar code.

Write Unit Tests

Generate thorough unit tests for a function.

Debug Assistant

Diagnose an error systematically: likely causes ranked with reasoning, the cheapest test for each, a...

Regex Builder

Build a regular expression from a plain-English requirement — explained token by token, tested again...

Commit Message Writer

Write a clean conventional commit message from a diff.