# AI2SQL

> AI SQL assistant that writes, explains, fixes and optimises queries against your real database schema.

AI2SQL is an AI SQL assistant that turns plain-English requests into SQL written for the schema and dialect of a connected database. AI2SQL also explains, fixes, optimises and formats existing queries, and can run them through a read-only connection. AI2SQL is used in the browser, through a desktop connector, or by AI agents over MCP and REST.

**Best for:** Analysts, developers and data engineers who work across several database dialects and want generated SQL that matches their actual tables, plus teams that need governed database access for AI agents.

- Official site: https://ai2sql.io
- Listed in: [AI Code Assistant](https://trendhub.net/ai-tools/category/code-assistant), [Data Analysis & Analytics](https://trendhub.net/ai-tools/category/data-analytics)
- Last checked: 2026-10-09 (facts taken from ai2sql.io)
- Source page: https://trendhub.net/ai-tools/ai2sql-ai-sql-query-generator-schema

## Key facts

- Platforms: Web, Windows, macOS, Linux, API, MCP
- Pricing model: Freemium
- Starting price: $9 per month (Start plan billed monthly; the site also quotes $7 per month when billed annually.)
- Free plan: Yes
- Free trial: Yes
- API: Yes
- Made by: AI2SQL

## What is AI2SQL?

AI2SQL is a text-to-SQL tool that generates queries from a description written in everyday English. Instead of guessing table names, it reads the live schema of a database you connect, so the joins, column names and dialect in the output match that system. The same workspace can explain an inherited query clause by clause, rewrite a slow one with reasons, correct syntax or dialect errors, tidy formatting and execute the statement over a read-only connection to show the rows. Ten databases are supported, among them PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery and MongoDB. A desktop Connector reaches databases on localhost or a private address, and a Gateway gives AI agents such as Claude or Cursor a rate-limited, audited MCP endpoint. Plans range from a free tier on a demo database to Start, Pro and Team subscriptions.

## Key features

- **Schema-Aware Generation**: Writes SQL from a plain-English request using the real tables, columns and relationships of the connected database.
- **Explain**: Walks through an existing query in plain language so you can understand it before running it.
- **Optimize**: Returns a rewritten version of a slow query together with the reasoning, such as a missing index.
- **Fix and Format**: Repairs queries that fail because of syntax, dialect or column-name mistakes, and applies consistent casing and indentation.
- **Read-Only Run**: Executes a query against a live connection and shows the rows, while a guard rejects write statements and schema changes such as UPDATE or DROP.
- **Agent Gateway**: Offers an MCP endpoint and REST API with keys scoped per agent, rate limits and a log of every query.

## How AI2SQL works

1. **Connect a database**: Point AI2SQL at a supported database using read-only credentials, which are encrypted at rest.
2. **Let it map the schema**: AI2SQL builds a semantic layer from the tables, joins and business terms it finds.
3. **Ask a question**: Describe the result you want, or have an agent call the query tool over MCP or REST.
4. **Read the answer**: The governed, read-only SQL is executed and the rows come back, with the query logged and metered.

## Use cases

- **Answering a Data Question**: An analyst describes the report needed and gets a query that uses the correct column names, then runs it to read the rows.
- **Speeding Up a Slow Query**: A backend developer pastes a working but slow statement and receives an optimised version.
- **Working Across Dialects**: A data engineer writes for PostgreSQL, Snowflake and BigQuery from one tool instead of recalling each syntax.
- **Giving an Agent Database Access**: A team lets Claude Code or Cursor query production data through a governed read-only endpoint.
- **Learning SQL**: A beginner reads the explanation attached to each generated query to see how the question maps to SELECT, JOIN and GROUP BY.

## Pricing

| Plan | Price | Billing | Includes |
| --- | --- | --- | --- |
| Free | Free | free, no payment | 3 queries a day; Demo database only; Read-only by default |
| Start | $9 | per month, or $7 per month billed annually | 100 SQL queries per month; Basic SQL generation; Explain SQL queries; Fix syntax errors; Chat support |
| Pro | $19 | per month, or $14 per month billed annually | Unlimited SQL queries; Database connectors; Query optimization and explanation; Desktop app; Priority support |
| Team | $39 | per month, or $29 per month billed annually | 5 users included; Everything in Pro; Shared query library; Role-based access control; Advanced analytics |

Prices as stated in the text of the official site, which says prices are in USD. Each paid plan starts with a 7-day free trial that requires a card.

Checked 2026-10-09 at https://ai2sql.io/

## Things to know

- **A card is needed for the trial**: Nothing is charged on the day you start, but the 7-day trial cannot begin without a card and must be cancelled before it ends to avoid payment.
- **Own databases need Pro or Team**: The Free plan runs only against a demo database.
- **Writes are blocked by default**: The service refuses INSERT, UPDATE, DELETE, DROP, other DDL and multi-statement input before they reach your database.
- **Generation is not offline**: Even with the desktop app, creating a query requires a connection to the AI2SQL API.

## FAQs

### What is AI2SQL?

AI2SQL is an AI SQL query generator that converts plain-English requests into SQL for a database you connect.

### What is AI2SQL used for?

AI2SQL is used to generate, explain, fix, optimise and format SQL, and to run queries read-only so the results can be checked.

### Is AI2SQL free?

AI2SQL has a Free plan that allows three daily queries against a demo database. Connecting your own database requires the Pro or Team plan.

### How much does AI2SQL cost?

AI2SQL lists Start at $9 per month, Pro at $19 per month and Team at $39 per month, with lower rates on annual billing. Each paid plan begins with a 7-day free trial for which a card is required.

### Does AI2SQL have an API?

Yes. AI2SQL provides a REST API and an MCP endpoint that MCP-compatible clients such as Cursor and Claude can call, with calls metered and logged.

### Which databases does AI2SQL support?

AI2SQL supports ten databases: MySQL, PostgreSQL, Oracle, SQL Server, BigQuery, Snowflake, MongoDB, Amazon Redshift, Firebird and SQLite.

### Is my database safe with AI2SQL?

AI2SQL connections are read-only by default: statements are classified before they reach the database and writes and DDL are blocked. Credentials are encrypted and each query is logged.

### Does AI2SQL work on the desktop or offline?

AI2SQL has a desktop app on the Pro plan, which is also the way to reach databases on localhost or an internal host. Query generation still needs a connection to the AI2SQL API.

---

Source: https://trendhub.net/ai-tools/ai2sql-ai-sql-query-generator-schema (trendhub)
