RootNia

NL-to-SQL

NL-to-SQL: query databases in plain language

In short

NL-to-SQL (Natural Language to SQL) is the RootNia module that translates questions asked in plain language into SQL queries over structured databases. Anyone on the team can get data without writing code and, combined with RAG, a single question can draw on both documents and databases.

Last updated ·

The problem: the data is there, but you need SQL to see it

Many business questions have an answer in a database, but getting it means writing a SQL query or asking the BI team. The result is request queues, late reports and decisions made on incomplete data.

What NL-to-SQL does

  • Interprets a plain-language question.
  • Translates it into a SQL query over the connected databases.
  • Returns the result without the user needing to know the schema or write code.

Documents and data in the same question

RootNia’s orchestrator connects both document repositories and databases. RAG handles documents and NL-to-SQL handles structured data, so a single question can draw on both.

Example: from question to query

Illustrative example of how it works, not a specific customer.

An operations manager asks: “How many orders were delivered late, by region, in September?” NL-to-SQL identifies the order and delivery tables, builds the query that groups delays by region and filters the month, runs it against the connected database and returns the result as a table — without the user needing to know the schema.

Limits and good practices

  • Clear schemas: understandable table and column names greatly improve the translation to SQL.
  • Ambiguous questions: “late” can be defined in several ways; the more specific the question, the more reliable the result.
  • Permissions: connect NL-to-SQL with read-only database users scoped to what each team should see.

Use cases

Frequently asked questions

What is NL-to-SQL?

The automatic translation of a plain-language question — for example, "how many open claims are there per region?" — into a SQL query the database can run.

Who can use it?

Anyone on the team with access, with no SQL knowledge. Technical profiles save time on ad hoc queries and the BI team gets fewer one-off requests.

How does it combine with RAG?

RAG answers over documents and NL-to-SQL over structured data. Together they handle questions that need both sources, such as cross-checking a contract against the transactions recorded in the database.

See it with your own documents

Book a 20-minute demo with a solutions engineer. Bring a sample of your documents and we will show you how RootNia classifies them and answers with traceable sources.