Skip to content
Menu

Notes ·

A Correct Query Can Still Answer the Wrong Question

In If You Think You Can Do Real-World Text-to-SQL, Michael Stonebraker and Peter Baile Chen challenge the idea that LLMs are ready to let anyone reliably query enterprise data using ordinary language.

“LLMs perform poorly, even when augmented with standard prompt engineering and RAG techniques.”

The biggest risk is not that the generated SQL fails. A failed query is visible. The dangerous query runs successfully, returns plausible numbers, and answers the wrong question.

A business user who does not know SQL may have no way to recognize that the model forgot a filter, joined the wrong table, used the wrong definition of revenue, or interpreted a vague request too literally. That result can quickly become accepted as canon and appear in meetings, presentations, and conversations with clients.

Semantic layers, documentation, and additional context can help the model understand schemas and business definitions. They cannot eliminate ambiguity in what a person intended to ask. Research specifically designed around ambiguous and unanswerable questions found that current systems still struggle to recognize when they need clarification.

The gap between demonstrations and enterprise use remains enormous. On Spider 2.0, which uses realistic enterprise workflows and databases containing more than 1,000 columns, an agent based on o1-preview solved only 21.3 percent of tasks. An internal LinkedIn system with extensive metadata, query history, documentation, and automated correction produced answers judged correct or close to correct only 53 percent of the time.

I see real value in analysts using LLMs to write SQL more productively. They understand the data, can inspect the query, and know when the answer does not make sense.

Giving the same tool directly to someone who cannot validate its work does not democratize analytics. It gives uncertainty the appearance of authority.

Read If You Think You Can Do Real-World Text-to-SQL.

All notes