# AI SQL Generator

> Describe a query in plain English and get SQL for your schema in PostgreSQL, MySQL, SQLite, BigQuery or SQL Server, checked by a real SQL parser. On-device.

- URL: https://www.tooljig.com/ai-sql-generator
- Category: [On-device AI](https://www.tooljig.com/category/ai.md)
- Runs: On-device AI in the browser (WebGPU or WebAssembly); nothing uploaded
- Price: free, no account needed

## What it does

Paste your table definitions, describe what you need, and the on-device model writes the query, runs it through a SQL parser for your dialect, fixes syntax errors and flags tables that are not in your schema before answering. Your schema never leaves your browser. The model runs inside your browser tab. Its weights download once from Hugging Face and can stay on your device; your text and files are never uploaded.

## How to use it

1. Paste the schema (one table per line is enough).
2. Choose the dialect.
3. Describe the query and copy the checked SQL.

## Good to know

- Syntax is checked; whether the query returns what you meant is up to you to test.
- Small models can make mistakes. Check important answers against the source; tool results and page citations make that quick.

## FAQ

### Is my data sent to a server or to an AI company?

No. Inference runs locally with ONNX Runtime in your browser. The only network traffic is the one-time model download from Hugging Face; nothing you type or open is transmitted.

### How big is the download, and does it happen every time?

The first run downloads the model once (about 250–600 MB depending on the model; the exact size is shown before you start). It is kept in your browser's storage by default, so later visits load it in seconds and work offline. You can turn that off or delete stored models on the model manager page.

## Related tools

- [SQL Formatter](https://www.tooljig.com/sql-formatter.md): Format SQL queries for PostgreSQL, MySQL, SQL Server, SQLite, BigQuery, Snowflake, Oracle and more. Choose keyword case and indentation.
- [Chat with CSV](https://www.tooljig.com/chat-with-csv.md): Ask questions about a CSV, TSV or JSON table in plain English. An on-device AI plans the query and exact counts and totals are computed by code. Nothing uploaded.
- [AI Regex Generator](https://www.tooljig.com/ai-regex-generator.md): Describe what to match and an on-device AI writes a regular expression, tests it against your sample with a real regex engine and fixes it before answering.
