Get started

InsightsAsking your company database

The AI's SQL runs fine. Why is the revenue number wrong?

The syntax is right and the answer is wrong

The demo is impressive. Ask for "the five best-selling products last month," and the AI writes the SQL (the language for querying databases) and returns the right answer at once. Connect the same AI to your company's business database, though, and it answers a revenue question from the quotes table and counts customers who closed their accounts. The SQL has no flaws. The answer is wrong.

What the AI lacks is not SQL. It doesn't know where revenue lives in this company's database. OwlAI builds that knowledge before the first question arrives: once you connect a database, it analyzes the tables one by one and writes descriptions of them, and when a question comes in, it picks tables based on those descriptions.

Business databases don't explain themselves by name

A demo database has a handful of tables with friendly names like customers and orders. A real business database has hundreds to thousands of tables with abbreviated names like TB_SL_ORD_D and CUST_MST_BK. Look-alike tables often sit side by side: a production table next to its backup, a table migrated from an old system next to a newly built one.

Columns are no better. You can't tell from the name what the value 03 in a STAT_CD column means, and which tables join to which is often not written down anywhere.

Current AI models know SQL syntax well enough. They are like a new hire with perfect syntax who is seeing the company's database for the first time. A veteran knows which table is the real one, what each code value means and which tables go together. For the AI to be accurate, it needs that knowledge first.

Connect a database, and it studies the database first

When an administrator connects a database and runs the analysis, OwlAI first gathers what the database already knows about itself: comments on tables and columns, keys and the links between tables, the statistics the database maintains (row counts, numbers of distinct values, null ratios, most frequent values), a few rows of real data drawn as a sample, and the SQL that business users have actually run against each table. All of it is queried directly from the database.

The AI then reads this material and interprets each table. For a code column whose meaning is unclear, it queries the value distribution itself and looks up the labels in the matching code table. From there it writes a table description and the meaning of each column, and works out which tables join through which columns. Finally, it combines the table analyses into a document that summarizes what business the whole database covers. Instead of guessing a table's meaning from its name, the AI interprets it from comments, statistics, real values, and the SQL your people actually ran.

Analysis result screen: six kinds of information attached to one table
Figure 1. Analysis result screen: six kinds of information attached to one table

Questions are answered from analyzed tables

When a question comes in, the AI first reads the database summaries to decide which database to look at. It then finds the analyzed tables that fit the question, checks their descriptions and column meanings, and only then writes the SQL. Out of thousands of tables, it narrows down to the few it needs.

Only analyzed tables are used in answers. On the database screen, administrators see at a glance what share of tables has been analyzed, which tables haven't been analyzed yet and which failed, and they run the analysis on the scope they need first. Because tables that haven't been analyzed are never used in answers, analyzing the tables your business uses first and leaving backup or temporary tables unanalyzed means the AI is less likely to pick the wrong table.

Less guessing means faster answers

On a database it has analyzed, the AI picks tables using the descriptions and column meanings the analysis left behind. There is no step where it guesses from table names. And because it doesn't scan the structure from scratch every time, it takes fewer steps to reach an answer.

The data knowledge your people have built up gets added on top. When a fact such as "this column used a different unit before 2023" comes up in a conversation, the AI records it as a note on that table, and from then on it shapes the answers of everyone who uses that table. “Only the old hand knew the data rules. Will the AI still know them?” covers how this works.

You can see the difference right away in a pilot. Instead of demo questions, try the business questions your teams ask every day.