Home » AI Data Analysis » Query With Questions

How to Query Your Database With Questions Instead of SQL

You can query your database by typing questions in plain English instead of writing SQL. The AI reads your database schema, translates your question into the correct SQL query, runs it against your database, and returns the results in a readable format. You ask "which customers ordered more than 5 times this year" and the AI handles the SELECT, JOIN, WHERE, and GROUP BY automatically.

Why Natural Language Queries Matter

SQL is a powerful language, but it creates a bottleneck in most organizations. Only developers and data analysts can write queries, which means everyone else has to wait for someone technical to pull the data they need. A sales manager who wants to know this month's top accounts, a marketing lead who wants to see campaign conversion rates, or a customer success manager who wants to check a client's order history all need to file a request and wait.

Natural language querying eliminates that bottleneck. Anyone who can type a question in English can query the database directly. The AI handles the translation from human language to SQL, runs the query, and presents the results. Technical accuracy stays the same because the underlying SQL is generated by a model that understands database structures and query syntax.

How It Works

Step 1: Connect your database.
Open the MySQL or PostgreSQL app and enter your database connection details. The AI connects and reads your database schema: table names, column names, data types, and foreign key relationships. This only happens once per connection. See How to Connect AI to Your Existing Business Database for setup details.
Step 2: Ask a question about your data.
Type your question as you would ask it to a colleague: "How many orders did we get last week?" or "Show me all customers in California with more than $10,000 in lifetime purchases" or "What is our average order value by product category for the last 3 months?"
Step 3: Review the results.
The AI returns the query results in a clean, readable format. For simple counts or totals, you get a direct answer. For lists and tables, you get formatted rows and columns. The AI also provides a brief explanation of what the results mean.
Step 4: Refine with follow-ups.
Ask follow-up questions that build on the previous results: "Now break that down by month," "Exclude returns from those numbers," "Sort by highest value first," "Show me just the ones from the East region." The AI modifies the query and returns updated results without you starting over.

What You Can Ask

The AI handles any query that SQL can express, which covers virtually any question about structured data:

Simple Lookups

Aggregations

Comparisons

Complex Queries

How the AI Understands Your Schema

When you first connect your database, the AI examines every table and column to build a map of your data. It understands that a column named "customer_id" in the orders table probably relates to the "id" column in the customers table. It recognizes date columns, numeric columns, and text columns and knows which operations make sense for each type.

If your column names are ambiguous (like "col1" or "field_a"), you can help the AI by explaining what they mean: "The col1 column in the orders table is the order date, and col2 is the total amount." The AI remembers this context for the rest of the conversation. For more on this, see How to Let AI Understand Your Database Schema Automatically.

Safety and Read-Only Access

Natural language queries are read-only by default. The AI generates SELECT statements, not INSERT, UPDATE, or DELETE commands. This means your data is safe. You can query freely without risk of accidentally modifying records. If you need to make changes, that requires explicit action through the inline editing feature, which has its own confirmation steps.

Cost: Each natural language query costs 2-4 credits using GPT-4.1-mini (the recommended model for routine queries). The database connection itself has no per-query charge. Complex questions that require the AI to write multi-step queries may use a reasoning model at 10-15 credits per query.

When to Use Natural Language vs SQL

Natural language querying is ideal for ad hoc questions, data exploration, and situations where the person asking the question does not know SQL. It covers 90% of everyday business questions. For highly optimized queries on very large tables, complex subqueries with specific performance requirements, or database administration tasks, writing SQL directly is still more efficient. The platform supports both approaches through the same database connection.

Query your database with plain English questions. Connect your MySQL or PostgreSQL database and start asking.

Get Started Free