Text to SQL

Draft SQL from a question and supplied schema without connecting to or running a database.

No sign-up Free to use

Your input

Combined text limit: 12,000 characters.

Your input is sent to the site's configured AI providers. If one cannot complete the request, another may receive it. Private files and results expire within one hour. Review the result before using it. Privacy details.

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

  1. Describe the question and paste the relevant table and column definitions.
  2. Choose the SQL dialect and add any business rules the query must respect.
  3. 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.

You add
What should the query return?: List the names of active customers. Database schema: customers(id INTEGER, name TEXT, active BOOLEAN) SQL dialect: MariaDB Query context: An active customer has active = 1.
You get
The result proposes SQL in the chosen dialect with quoted schema evidence and stated assumptions. Missing schema details can produce questions instead of a query.

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.