# AI2SQL > AI-powered SQL query builder and generator. Describe what you need in plain English and AI2SQL > writes correct, dialect-aware SQL for PostgreSQL, MySQL, SQL Server, Snowflake, BigQuery, > MongoDB and Oracle. Claude, Claude Code, Cursor, VS Code and ChatGPT connect over MCP with > OAuth (https://builder.ai2sql.io/api/chatgpt-mcp) — setup guide at https://ai2sql.io/mcp. > Scripts and custom agents use the API-key MCP server (https://builder.ai2sql.io/api/mcp). > Both are governed, read-only and metered. Key facts: - Product app and API live at https://builder.ai2sql.io (signup: https://builder.ai2sql.io/signup) - Pricing (source of truth: https://ai2sql.io/pricing): Free plan with 3 SQL queries a day on a demo database; Start $9/month, Pro $19/month, Team $39/month (save 25% billed annually); one-time Lifetime plan $29 - Every paid plan starts with a 7-day trial; a credit card is required to start the trial - Connecting your own database is part of Pro and Team - MCP tools (OAuth server): generate_sql, fix_sql, optimize_sql, explain_sql, convert_sql, list_connections, describe_schema, run_query (read-only) - Live schema browsing and run_query: PostgreSQL, MySQL, SQL Server - 50,000+ users across 80+ countries ## Main pages - [Homepage](https://ai2sql.io/): Product overview, capabilities and pricing - [MCP setup](https://ai2sql.io/mcp): Use AI2SQL inside Claude, Claude Code, Cursor, VS Code and ChatGPT - [Pricing](https://ai2sql.io/pricing): Plans, prices, the 7-day trial and the free plan, with a pricing FAQ - [AI2SQL Connector](https://ai2sql.io/connector): Desktop app that connects databases on localhost or a private network - [API and MCP reference](https://builder.ai2sql.io/api-docs.html): REST API and API-key MCP server documentation - [AI2SQL Gateway](https://ai2sql.io/gateway): Safe, read-only, audited database access for AI agents over MCP - [Learn SQL](https://ai2sql.io/learn): Free SQL converters, dialect guides and function references - [SQL templates](https://ai2sql.io/sql-templates): Copy-ready SQL for Stripe (MRR, churn, failed payments), Shopify (orders, LTV, schema) and Supabase (auth.users, cohorts) data - [Jev table selection (coming soon)](https://ai2sql.io/jev): One call to Jev, TypeSafe's decision model, ranks every table in a schema before text-to-SQL; waitlist open - [Blog](https://ai2sql.io/blog): SQL guides, AI query tips and database deep-dives - [Contact](https://ai2sql.io/contact) ## AI2SQL Gateway — connect AI agents to a database (MCP) - [Connect Claude to PostgreSQL](https://ai2sql.io/connect-claude-to-postgres): Give Claude read-only, audited access to Postgres over MCP - [Connect Cursor to PostgreSQL](https://ai2sql.io/connect-cursor-to-postgres): Wire Cursor's agent to Postgres, read-only and logged - [Connect ChatGPT to a SQL database](https://ai2sql.io/connect-chatgpt-to-database): Add a governed database connector to ChatGPT over MCP - [How to give an AI agent read-only database access](https://ai2sql.io/ai-read-only-database-access): The layers that make read-only actually hold - [Is it safe to connect AI to your production database?](https://ai2sql.io/is-it-safe-to-connect-ai-to-database): The real risks and how a gateway neutralises each - [What is a database MCP server?](https://ai2sql.io/what-is-a-database-mcp-server): How MCP database servers work, read-only vs unrestricted, server vs gateway - [Postgres MCP server options compared (2026)](https://ai2sql.io/postgres-mcp-server-comparison): Official server, Postgres MCP Pro, DBHub, Supabase MCP and AI2SQL Gateway - [AI2SQL Gateway vs a raw Postgres MCP server](https://ai2sql.io/ai2sql-gateway-vs-postgres-mcp): Honest head-to-head: hosting, read-only enforcement, audit, cost - [How to approve AI-generated SQL before it runs](https://ai2sql.io/approve-ai-generated-sql-before-it-runs): Keep a human step between generating SQL and running it; how AI2SQL handles it ## Working with SQL you already have Each of these opens with a tool that takes a pasted query — paste it and get an explanation, a fix or a faster rewrite. No account needed for the first one. - [Understand a complex SQL query](https://builder.ai2sql.io/blog/understand-complex-sql-queries-with-ai): Read a query nobody documented, in execution order, with the join and grouping traps called out - [Fix a SQL query from its error message](https://builder.ai2sql.io/blog/fix-sql-queries-with-ai): ORA-00979, 1064, 42601 and friends: what the code means and the single change that fixes it - [Optimize a slow SQL query](https://builder.ai2sql.io/blog/optimize-slow-sql-queries-with-ai): Non-SARGable filters, correlated subqueries, missing indexes — what to change and how to confirm it - [Understand and debug legacy Oracle SQL](https://builder.ai2sql.io/blog/understand-and-debug-legacy-oracle-sql): ROWNUM before ORDER BY, NVL hiding a failed join, and the other five bugs in old ERP reports - [Debug a stored procedure](https://builder.ai2sql.io/blog/debug-stored-procedures-with-ai): Isolating the failing statement, parameter sniffing, transaction and NULL-parameter traps - [Best AI tools for Oracle SQL (2026)](https://builder.ai2sql.io/blog/best-ai-tools-for-oracle-sql-2026): Which tools stay in Oracle dialect instead of emitting LIMIT and calling it Oracle - [Best AI tools for SQL Server (2026)](https://builder.ai2sql.io/blog/best-ai-tools-for-sql-server-2026): T-SQL correctness: TOP, MERGE, OFFSET FETCH, and the SSMS and Copilot options compared - [Best AI SQL query optimizers (2026)](https://builder.ai2sql.io/blog/best-ai-sql-query-optimizers-2026): What a text-level optimizer can fix and where a database tuning advisor is still required - [Connect AI to a local SQL Server database](https://builder.ai2sql.io/blog/connect-ai-to-local-sql-server-database): Why localhost and 192.168.x.x cannot be reached by a cloud tool, and the local connector that solves it - [ChatGPT for SQL vs AI2SQL](https://builder.ai2sql.io/blog/chatgpt-for-sql-vs-ai2sql): An honest comparison: where the general assistant is enough and where schema and dialect break it ## AI SQL tools compared - [Best AI SQL tools (2026)](https://builder.ai2sql.io/blog/best-ai-sql-tools-2026): AI2SQL, ChatGPT, GitHub Copilot, DataGrip AI, Amazon Q, DBeaver AI and SQL Chat compared on accuracy, schema access and price - [Text-to-SQL: the complete guide](https://builder.ai2sql.io/blog/text-to-sql-complete-guide): What text-to-SQL is, how it works, where it falls short and how to try it ## Popular guides & converters - [CASE WHEN in PostgreSQL - Examples & AI Generator](https://ai2sql.io/learn/case-when-in-postgresql): CASE WHEN in PostgreSQL examples and syntax. Generate optimized CASE WHEN queries in 10 seconds with AI2sql. - [MySQL to PostgreSQL Converter - Free Online Tool 2025](https://ai2sql.io/learn/mysql-to-postgresql-converter): Convert MySQL queries to PostgreSQL instantly. Free online converter with AI-powered syntax and data type mapping. No si - [MySQL to SQL Server Converter - Free Online Tool 2025](https://ai2sql.io/learn/mysql-to-sql-server-converter): MySQL to SQL Server migration guide with conversion examples, syntax differences, and best practices. Generate SQL Serve - [DATEADD in Oracle - Examples & AI Generator](https://ai2sql.io/learn/dateadd-in-oracle): DATEADD in Oracle examples and syntax. Generate optimized DATEADD queries in 10 seconds with AI2sql. - [SQL Server to MySQL Converter - Free Online Tool 2025](https://ai2sql.io/learn/sql-server-to-mysql-converter): Comprehensive SQL Server to MySQL migration guide: data type mapping, syntax differences, conversion steps, and error-fr - [Oracle to PostgreSQL Converter - Free Online Tool 2025](https://ai2sql.io/learn/oracle-to-postgresql-converter): Comprehensive Oracle to PostgreSQL migration guide with syntax conversion examples, data type mapping, best practices, a - [DATEADD in Snowflake - Examples & AI Generator](https://ai2sql.io/learn/dateadd-in-snowflake): DATEADD in Snowflake examples and syntax. Generate optimized DATEADD queries in 10 seconds with AI2sql. - [Oracle to SQL Server Converter - Free Online Tool 2025](https://ai2sql.io/learn/oracle-to-sql-server-converter): Complete Oracle to SQL Server migration guide, with conversion examples, syntax differences, and step-by-step instructio - [SAP HANA AI SQL Generator | AI2SQL](https://ai2sql.io/learn/sap-hana-ai-sql-generator): SAP HANA AI SQL generator. Create optimized SAP HANA queries from natural language in 10 seconds with AI2sql. - [yaml to sql converter in SQL - Examples & AI Generator](https://ai2sql.io/learn/yaml-to-sql-converter): yaml to sql converter in SQL examples and syntax. Generate optimized yaml to sql converter queries in 10 seconds with AI - [ROW NUMBER in PostgreSQL - Examples & AI Generator](https://ai2sql.io/learn/row-number-in-postgresql): ROW NUMBER in PostgreSQL examples and syntax. Generate optimized ROW NUMBER queries in 10 seconds with AI2sql. - [DATEADD in SQLite - Examples & AI Generator](https://ai2sql.io/learn/dateadd-in-sqlite): DATEADD in SQLite examples and syntax. Generate optimized DATEADD queries in 10 seconds with AI2sql. - [Grafana SQL Variables - Step-by-Step Guide](https://ai2sql.io/learn/grafana-sql-variables): Complete Grafana SQL Variables tutorial: setup, BI examples, advanced techniques. Instantly generate ready-to-use SQL qu - [REGEXP_REPLACE in SQL Server - Examples & AI Generator](https://ai2sql.io/learn/regexp-replace-in-sql-server): REGEXP_REPLACE in SQL Server examples and syntax. Generate optimized REGEXP_REPLACE queries in 10 seconds with AI2sql. - [SQL Bulk Insert Optimization - Best Practices & Solutions](https://ai2sql.io/learn/sql-bulk-insert-optimization): Master SQL Bulk Insert Optimization: techniques, performance improvements, and best practices with live code examples. G - [Superset SQL Templates — Examples & 2025 Guide](https://ai2sql.io/learn/superset-sql-templates): Explore the ultimate guide to Superset SQL Templates (2025): real-world examples, use cases, and how AI2sql lets you gen - [LISTAGG in PostgreSQL - Examples & AI Generator](https://ai2sql.io/learn/listagg-in-postgresql): LISTAGG in PostgreSQL examples and syntax. Generate optimized LISTAGG queries in 10 seconds with AI2sql. - [MERGE INTO in Oracle - Examples & AI Generator](https://ai2sql.io/learn/merge-into-in-oracle): MERGE INTO in Oracle examples and syntax. Generate optimized MERGE INTO queries in 10 seconds with AI2sql. - [Oracle to MySQL Converter - Free Online Tool 2025](https://ai2sql.io/learn/oracle-to-mysql-converter): Oracle to MySQL migration guide with conversion examples, syntax differences, and best practices. Generate MySQL queries - [Access to MySQL Converter - Free Online Tool 2025](https://ai2sql.io/learn/access-to-mysql-converter): Access to MySQL migration guide with conversion examples, syntax differences, and best practices. Generate MySQL queries ## SQL tools - [SQL vs Excel: Key Differences Explained (2026)](https://ai2sql.io/is-sql-like-excel-understanding-the-key-differences-and-how-ai2sql-bridges-the-gap): SQL handles millions of rows; Excel handles hundreds. See side-by-side examples, real queries, and how to generate SQL f - [Learn SQL in 7 Days: Free Day-by-Day Plan (2026)](https://ai2sql.io/can-i-learn-sql-in-7-days-a-step-by-step-guide-for-beginners): Go beyond SQL reference docs—follow a free 7-day plan from SELECT to JOINs & GROUP BY. Write your first SQL query in 10 - [Build Your Own AI Agent Team in 15 Min — Free OpenClaw Guide](https://ai2sql.io/how-to-build-your-own-ai-agent-team-with-openclaw-in-15-minutes): Build your first AI agent team in 15 minutes — free. Step-by-step OpenClaw guide with ready-to-use templates and conf - [AI-Powered PL/SQL Query Generator for Oracle](https://ai2sql.io/pl-sql-query-generator): Generate Oracle PL/SQL queries instantly with AI2SQL. No syntax errors, no setup. Try free and build PL/SQL faster. - [How to Create Studio Ghibli-Style Images with ChatGPT: A Step-by-Step Tutorial](https://ai2sql.io/how-to-create-studio-ghibli-style-images-with-chatgpt-a-step-by-step-tutorial): Unlock the magic of Ghibli! Learn how to use ChatGPT to generate stunning Studio Ghibli-style images. This step-by-step - [Common SQL Error Codes](https://ai2sql.io/common-sql-error-codes): Understand common SQL error codes and what causes errors like -911, -924, -927, -923 and more. Clear explanations to hel - [Manus AI: The Hands-On Revolution in Autonomous Digital Assistance](https://ai2sql.io/manus-ai): Discover Manus AI by Monica—a groundbreaking autonomous AI agent that redefines digital assistance by executing complex - [Oracle Query Optimization Tool: SQL Performance Tuning](https://ai2sql.io/optimize-oracle-query): Optimize Oracle SQL queries automatically. AI-powered performance tuning, execution plan analysis, and query optimizatio - [7 SQL Indexing Rules That Cut Query Time by 90% (2026)](https://ai2sql.io/sql-indexing-best-practices-speed-up-your-queries): Stop slow queries. These 7 indexing strategies reduced query time from 12s to 0.3s. B-tree vs hash comparison with Postg - [Text2SQL: Turn Plain English Into SQL Queries](https://ai2sql.io/text2sql): Text2SQL turns plain English into correct SQL in seconds. Free AI SQL query generator for MySQL, PostgreSQL, SQL Server, - [Sql insert generator | efficient data input](https://ai2sql.io/insert-query-generator): Create optimized SQL INSERT queries for single and bulk data operations with our AI generator. - [PL/SQL AI Tools: Online Compiler & Query Generator](https://ai2sql.io/plsql-ai): Generate and compile PL/SQL code with AI assistance. Free online PL/SQL compiler, code generation, and optimization tool - [SQL Query Generator](https://ai2sql.io/sql-query-generator-use-cases): AI2SQL turns plain text into SQL queries instantly. Supports travel, e-commerce, healthcare & more. Try free with real p - [AI-Powered Database Design: Revolutionizing ER Diagram Analysis with AI2SQL](https://ai2sql.io/ai2sql-er-diagram-analysis): Transform ER diagrams to SQL code effortlessly with AI2SQL. Our AI-powered tool ensures accurate and efficient database - [How to Migrate from Excel to SQL: A Step-by-Step Tutorial for 2025](https://ai2sql.io/migrate-excel-to-sql-tutorial-2025): Learn how to migrate from Excel to SQL in 7 simple steps! This 2024 tutorial covers data cleaning, schema design, and AI ## Recent blog posts - [OpenAI launches GPT-6 Astra](https://ai2sql.io/ai-blog/openai-gpt-6-astra-announcement) - [Best Free SQL Practice Datasets for Beginners in 2026](https://ai2sql.io/ai-blog/best-free-sql-practice-datasets-for-beginners-in-2026) - [How to Write an SQL Query to Select Only Non-Empty Values](https://ai2sql.io/ai-blog/how-to-write-an-sql-query-to-select-only-non-empty-values) - [Excel to SQL Converter - Transform Spreadsheets into Database Queries](https://ai2sql.io/ai-blog/excel-to-sql-converter-convert-spreadsheet-to-sql-queries-ai2sql) - [DAX vs SQL: Key Differences and When to Use Each](https://ai2sql.io/ai-blog/dax-vs-sql-key-differences-and-when-to-use-each) - [How to Write an SQL Query to Count Users in a Table (With AI2sql Guide)](https://ai2sql.io/ai-blog/how-to-write-an-sql-query-to-count-users-in-a-table-(with-ai2sql-guide)) - [dbt-core vs SQLMesh in 2026: Which SQL Transformation Tool Should You Pick?](https://ai2sql.io/ai-blog/dbt-core-vs-sqlmesh-in-2026-which-sql-transformation-tool-should-you-pick) - [Turn Excel Data into SQL Instantly with AI2sql](https://ai2sql.io/ai-blog/turn-excel-data-into-sql-instantly-with-ai2sql) - [YAML to SQL Converter](https://ai2sql.io/ai-blog/yaml-to-sql-converter-convert-yaml-to-sql-queries-ai2sql) - [How to Write an SQL Query to Get Monthly Active Users (MAU)](https://ai2sql.io/ai-blog/how-to-write-an-sql-query-to-get-monthly-active-users-(mau))