Home » AI Databases » Natural Language Query

How to Query Your Database With Plain English

The AI SQL assistant lets you ask questions about your database in plain English and get results instantly. Type something like "show me all orders from last month over $100" and the AI writes the SQL query, runs it against your MySQL or PostgreSQL database, and returns the results in a readable table. No SQL knowledge required.

How It Works

When you connect your database to the platform, the AI reads your entire schema: every table, column, data type, and relationship. It uses this understanding to translate your English questions into accurate SQL. The AI knows which tables to query, which columns to filter on, how to join related tables, and how to format the output.

You type your question in the query interface, and the AI generates a SQL statement behind the scenes. The query runs against your live database, and the results appear in a formatted table. You can see the generated SQL if you want to verify what ran, copy it for use elsewhere, or refine it manually.

What You Can Ask

Simple Lookups

Start with straightforward questions to find specific records. "Show me customer John Smith" or "find all products in the Electronics category" or "what orders were placed today." The AI handles the WHERE clauses and column selection automatically.

Aggregations and Summaries

Ask for totals, averages, counts, and groupings. "How many orders did we get each month this year" or "what is the average order value by state" or "which product has the most returns." The AI writes GROUP BY queries with the right aggregate functions.

Multi-Table Queries

Questions that span multiple tables work naturally. "Show me customer names with their most recent order date" or "list all products that have never been ordered." The AI uses your foreign keys and relationships to write the correct JOIN statements.

Date and Time Filtering

The AI understands relative time references. "Orders from last week," "customers who signed up in January," "transactions from the last 30 days," and "sales year to date" all translate into the correct date comparisons for your database.

Complex Analysis

For deeper analysis, you can ask multi-part questions. "Compare sales this quarter to last quarter by product category" or "show me customers who bought product A but not product B" or "what percentage of support tickets were resolved within 24 hours." The AI handles subqueries, CTEs, and window functions as needed.

Tips for Better Results

Safety note: By default, natural language queries run as SELECT statements. The AI will not modify your data unless you explicitly ask it to and your database user has write permissions. For read-only exploration, connect with a user that only has SELECT privileges.

When the AI Gets It Wrong

Occasionally the AI might pick the wrong table or misinterpret an ambiguous question. When this happens, rephrase your question with more specific column or table names. You can also tell the AI "use the orders table, not the transactions table" to guide it. The more you use the system with your specific database, the more precise your questions become because you learn which terms map to which tables.

For technical details on how the AI reads and uses your schema, see How the AI SQL Assistant Understands Your Database Schema.

Ask questions about your data in plain English. Connect your database and start querying in minutes.

Get Started Free