Text to SQL
Draft SQL from a question and supplied schema without connecting to or running a database.
Fill in the fields, then submit when you are ready.
Result
Your result will appear here after you submit and complete verification.
How to use Text to SQL
- Describe the question and paste the relevant table and column definitions.
- Choose the SQL dialect and add any business rules the query must respect.
- Select Draft SQL, verify your browser and inspect the query before using it elsewhere.
Example: Text to SQL
Draft a query against an explicitly supplied table.
Options
- SQL dialect
- Choose MariaDB, MySQL, PostgreSQL, SQLite or SQL Server. Syntax and functions vary between engines and versions.
- Schema and rules
- Supply definitions and relationships rather than a production data export. Explain statuses, date boundaries and other rules that affect the answer.
Supported inputs and limits
- Questions allow 2,000 characters and schema text 6,000.
- SQL can be wrong or destructive despite genuine schema quotes.
- This tool does not connect, execute, validate permissions or estimate query cost.
- Review it in a suitable test environment first.
Where your input is processed
Your input is uploaded to this site and sent to a configured AI provider. If a provider fails, the request may be sent to the next eligible provider. Check its result before use. Private inputs and results expire within one hour and are excluded from site backups; temporary files are removed by scheduled cleanup. Provider retention rules may differ. Avoid submitting passwords or highly sensitive information.
Check the rows before checking the total
Review which records enter the query, how tables join and whether a join can duplicate rows. Then check date ranges, null handling and aggregation. Compare the result with a small known dataset before using it for a decision. A syntactically plausible query can answer a different question from the one you intended, so keep the business rules beside the schema during review.
Questions about Text to SQL
Do I need database credentials?
No. Do not paste passwords or connection strings. Only the question, schema excerpt and necessary rules are needed.
Does a source quote prove the query is correct?
It shows that an identifier appears in supplied schema text. It does not prove joins, filters, aggregation or business meaning are correct.
What if the schema is incomplete?
The result may ask for missing details. Provide the relevant definitions instead of allowing a guessed table or relationship into a real query.