Back to blog
natural language sql ai sql query natural language to sql

Natural Language SQL: Ask Questions About Your Data in Plain English

March 17, 2026

Natural Language SQL: Ask Questions About Your Data in Plain English

SQL is a great language for querying data. It’s also a language that not everyone knows — or wants to learn for occasional use. Natural language to SQL bridges that gap: describe what you want, get SQL back, run it.

This post covers how NL→SQL works, when it’s genuinely useful, its limitations, and how RowLeap implements it with a privacy-first approach.

What Is Natural Language to SQL?

Natural language to SQL (NL→SQL) is a technique where an AI model translates a plain-English description of a query into valid SQL. The model receives the schema of your data (table names, column names, types) as context, and produces a SQL statement that answers your question.

A simple example:

You type: “Show me all orders from last month with a total over $500, sorted by total descending”

The model generates:

SELECT order_id, customer_id, total, order_date
FROM orders
WHERE order_date >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL 1 MONTH)
  AND order_date < DATE_TRUNC('month', CURRENT_DATE)
  AND total > 500
ORDER BY total DESC;

You’d run that yourself. Instead, you typed a sentence.

Who Is This Actually For?

Analysts who know what they want but not always how to express it in SQL. You might write SQL daily but blank on window function syntax. Typing “rolling 7-day average of daily signups” and getting working SQL back is faster than googling.

Business users who don’t write SQL. Product managers, marketers, operations — people who work with data but aren’t developers. NL→SQL lets them explore data without needing a data team to write queries for them.

Developers prototyping. When you’re exploring a new dataset, NL→SQL is useful for quickly generating skeleton queries that you then refine.

People doing one-off analysis. “I just need the answer to this one question” — typing it in English and getting SQL is faster than writing it from scratch.

How RowLeap Implements NL→SQL

RowLeap’s natural language mode uses built-in AI — no API key required. Here’s what happens when you use it:

  1. You toggle NL mode (Cmd+Shift+N / Ctrl+Shift+N, or click the NL button in the toolbar).
  2. You type your question in plain English.
  3. RowLeap sends your schema — table names, column names, types — to the AI. No data rows are sent. Only structure.
  4. The AI generates SQL. RowLeap displays the generated query so you can review it before running.
  5. You run or edit the SQL. The generated query appears in the editor. You can modify it, save it, or just run it.

The key privacy property: your data rows never leave your machine. The AI only sees column names and types. This is different from cloud-based NL→SQL tools that upload your data to run queries against it.

Download RowLeap — try NL→SQL with your own files →

Privacy-First: Why It Matters

Most NL→SQL tools on the market are web-based and require uploading your data:

  • ChatDB, AI2SQL, QueryGPT — all cloud tools where your file or database contents are processed on their servers
  • Excel Copilot — processes through Microsoft’s cloud
  • Databricks AI-assisted queries — processed in the cloud data warehouse

For work data — customer lists, financial records, user behavior data, internal metrics — uploading to third-party servers is often not allowed by company policy, and sometimes not legal depending on data residency requirements.

RowLeap is a desktop app. All your data stays local. The only thing that touches the internet is the schema (column names and types) when you use NL mode, and that outbound call is made over a secure connection. No API key required — it just works.

If you’re working with sensitive data and want to keep it fully offline, RowLeap also supports regular SQL mode with no external connections at all.

Real Examples: What Works Well

Exploratory analysis:

“What are the top 5 product categories by revenue this quarter?”

Date-based filtering:

“Show me users who signed up in the last 30 days but haven’t completed their profile”

Multi-table reasoning:

“Which customers have placed more than 3 orders and have a total spend above $1000?”

Aggregations:

“Count distinct customers per region, only include regions with more than 100 customers”

Simple transformations:

“Calculate the average order value by day of week”

For well-structured questions against tables with clear column names, NL→SQL works reliably. The model is especially good at:

  • Date/time calculations
  • Multi-condition filters
  • Aggregations and groupings
  • Identifying the right columns from descriptions

Where NL→SQL Falls Short

It’s worth being honest about limitations:

Ambiguous column names. If your CSV has columns named v1, dt, amt, the model has to guess what they mean. NL→SQL works best when column names are descriptive.

Complex multi-step transformations. Operations that require multiple CTEs, custom window functions, or recursive queries are harder to describe in plain English and harder for the model to get right on the first attempt. Write SQL for those.

Large schemas. When a table has 200+ columns, the model sees all of them and may pick the wrong one. Works best on focused datasets with fewer than ~50 columns.

Verification gap. The generated SQL might be syntactically valid but logically wrong — it answers a subtly different question than you asked. Always review the generated SQL before relying on the result.

RowLeap always shows you the generated SQL before running it. Treat it as a starting point, not a black box.

NL→SQL as a Learning Tool

An underrated use of NL→SQL: learning SQL. If you’re trying to get better at SQL, you can:

  1. Ask a question in plain English
  2. See what SQL the model generates
  3. Read it, understand it, modify it

The generated SQL is runnable and inspectable. It’s a fast way to see correct SQL for patterns you’d otherwise have to look up.

Comparing NL→SQL Tools

ToolData PrivacyWorks OfflinePlatformSQL Visibility
ChatDB❌ CloudNoWebPartial
AI2SQL❌ CloudNoWebYes
Databricks AI❌ CloudNoCloudYes
Excel Copilot❌ CloudNoDesktopNo
RowLeap✅ LocalYes (SQL mode)DesktopYes (always)

The key differentiator for RowLeap: local data, transparent SQL, desktop app. You get AI-assisted querying without giving up control of your data.

Try RowLeap free for 30 days →

Getting Started with NL Mode

  1. Download and install RowLeap.
  2. Drag in a CSV, SQLite, or Parquet file.
  3. Press Cmd+Shift+N (macOS) or Ctrl+Shift+N (Windows/Linux) to switch to NL mode.
  4. Type your question. Press Enter.
  5. Review the generated SQL in the editor. Run it.

NL mode requires an internet connection. SQL mode works fully offline.


See also: How to Query CSV Files with SQL (No Database Required) · Getting Started with RowLeap: A 5-Minute Guide

Try RowLeap free for 30 days

No cloud. No accounts. Just your data and SQL.

Download free trial →