DEV Community

Abd Alrhman Alloush
Abd Alrhman Alloush

Posted on

How to Query Your Database in Plain English (No SQL Required)

Here's a scenario that happens more than it should:

A manager walks up to an engineer and asks: "How many active customers do we have by region?"

The engineer knows the data exists. But answering the question requires:

  • Remembering which database it's in (or asking)
  • Recalling the table structure — is it customers, users, or accounts?
  • Writing the join between two or three tables
  • Figuring out what "active" means in this schema — is it a boolean column, a status string, or a date range?
  • Running the query, fixing the syntax error, running it again
  • Formatting the output

Twenty minutes later, the manager has their answer. The engineer has lost their flow.

This is a solved problem — and the solution is not "make engineers faster at SQL."


TL;DR

Query1AI is a natural language query tool built into 1DataCloud. You ask a question in plain English, it reads your database schema automatically, generates the SQL, and executes it read-only. Results come back as a table or chart. You can export to CSV. Try it free →


How Natural Language Querying Actually Works

The promise of "query your database in plain English" has been around for a while. Most implementations fall short because they generate generic SQL without understanding your specific schema.

Query1AI works differently. Before it generates any SQL, it fetches your actual database schema — table names, column names, data types, indexes, and relationships. It uses that context when generating the query, which means:

  • It knows your table is called user_accounts, not users
  • It knows status is an ENUM with values 'active', 'inactive', 'pending'
  • It knows that orders joins to products via product_id, not item_id

The result is SQL that actually runs against your database, not a template that needs to be corrected.


Real Examples

Here are actual questions you can ask, and what gets generated:

Question: "How many active users do we have by region?"

SELECT region, COUNT(*) AS active_users
FROM user_accounts
WHERE status = 'active'
GROUP BY region
ORDER BY active_users DESC;
Enter fullscreen mode Exit fullscreen mode

Question: "Show me the top 10 products by revenue last month"

SELECT p.product_name, SUM(o.revenue) AS total_revenue
FROM orders o
JOIN products p ON p.id = o.product_id
WHERE o.created_at >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1 month')
  AND o.created_at < DATE_TRUNC('month', CURRENT_DATE)
GROUP BY p.product_name
ORDER BY total_revenue DESC
LIMIT 10;
Enter fullscreen mode Exit fullscreen mode

Question: "Which customers haven't placed an order in the last 90 days?"

SELECT c.id, c.email, c.created_at, MAX(o.created_at) AS last_order_date
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id
GROUP BY c.id, c.email, c.created_at
HAVING MAX(o.created_at) < NOW() - INTERVAL '90 days'
   OR MAX(o.created_at) IS NULL
ORDER BY last_order_date ASC NULLS FIRST;
Enter fullscreen mode Exit fullscreen mode

Question: "Give me the average response time per API endpoint for this week"

SELECT endpoint, ROUND(AVG(response_time_ms), 2) AS avg_response_ms,
       COUNT(*) AS request_count
FROM api_logs
WHERE created_at >= DATE_TRUNC('week', CURRENT_DATE)
GROUP BY endpoint
ORDER BY avg_response_ms DESC;
Enter fullscreen mode Exit fullscreen mode

The Workflow in Practice

Here's the actual flow when you use Query1AI:

Step 1 — Connect a database
Pick any instance from your 1DataCloud inventory. Works with MySQL, PostgreSQL, Redshift, BigQuery, Spanner, DynamoDB, and more.

Step 2 — Schema is loaded automatically
Query1AI fetches table names, columns, types, indexes, and relationships. No manual mapping. No configuration.

Step 3 — Ask your question
Type it naturally. You don't need to use SQL syntax, name the tables, or specify the join. Just describe what you want to know.

Step 4 — Review the generated query
Query1AI shows you the SQL before executing. You can inspect it, modify it, or just run it.

Step 5 — Execute and explore
Results come back as a paginated table. Switch to chart view (bar, line, or pie) without leaving the interface. Export to CSV with one click.


Who Gets the Most Value

Developers who know what data should exist but don't want to look up the schema every time they need a quick answer.

DBAs who get asked business questions by non-technical stakeholders all day. Now those stakeholders can answer their own questions.

DevOps engineers who need to pull operational data — running instance counts, error rates, connection metrics — without writing custom scripts.

Managers and data teams who need production data answers but shouldn't need to file a ticket every time they have a question.


What It Won't Do (By Design)

Query1AI is read-only. It will never run INSERT, UPDATE, DELETE, or DDL statements — even if you ask it to. This is intentional. The goal is to give people access to data, not to give them write access to production.

There are also current limitations worth being upfront about:

  • One database per session today — cross-database querying (asking a question that spans multiple instances) is in active development
  • Read-only only — if you need to write data, you still need direct database access

The Security Model

Before you connect a production database to anything, you should ask how credentials are handled.

In 1DataCloud:

  • Credentials are encrypted at rest using Fernet encryption
  • They are never exposed in the UI or logs
  • All query execution is read-only — guardrails are enforced at the application layer, not just by trusting the LLM
  • Nothing is installed on your database nodes

Try It

If you're managing a database that people constantly come to you with questions about, Query1AI is worth trying. It takes about 2 minutes to connect your first database.

👉 1datacloud.ai/queryai

👉 Start free


What questions do you get asked about your database most often? Curious whether Query1AI handles your specific schema patterns — drop them in the comments.

Top comments (0)