cs.CLOct 24, 2026

Schema-Free Text-to-SQL: Learning Enterprise Database Structure from Query Logs

Authors: Ömer Faruk Akgül, Nikhil Kapahi, Prajit Reddy Muppidi

Organizations: University of Southern California · Amazon

Abstract

Text-to-SQL systems achieve remarkable accuracy on academic benchmarks, yet performance drops dramatically in enterprise deployments. This gap stems from a fundamental assumption: existing approaches require complete schema documentation, but enterprise databases typically lack comprehensive documentation, featuring cryptic naming and implicit relationships. We present the first text-to-SQL framework that operates without schema documentation, instead learning database structure from historical query logs. Query logs encode implicit structural knowledge: which tables are queried together, how they join, and what columns map to business concepts. We construct a knowledge graph from parsed query patterns and introduce entity-driven GraphRAG retrieval that grounds user questions in domain terminology rather than relying solely on embedding similarity. Validated on both an industrial deployment with expert evaluation and the Beaver benchmark, our approach substantially outperforms similarity-based retrieval methods, the dominant industry approach, in both executability and answer quality. On Beaver, we achieve 95.7% execution validity compared to 60.8% for embedding-based retrieval, with expert data engineers preferring our system 70% to 10% on internal deployment. Our work demonstrates that text-to-SQL can operate effectively in schema-ambiguous enterprise environments, enabling natural language database interfaces "in the wild".

Figures & tables

Appendix figures & tables8 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. EntSQL: A Benchmark for Grounding Text-to-SQL in Long-Context Enterprise Knowledge

    Jun 2, 2026Chengxi Liao, Tao Xu, Zulong Chen +7LLM GroundingText-to-SQL

  2. ProSPy: A Profiling-Driven SQL-Python Agentic Framework for Enterprise Text-to-SQL

    Jun 4, 2026Zhaorui Yang, Huawei Zheng, Sen Yang +14Text-to-SQLRelational Databases

  3. BIRD-History: A Benchmark for History-Driven Text-to-SQL with Fine-Grained Knowledge Annotations

    Aug 29, 2026Yunfan Zhou, Qiming Shi, Yizhou Yang +2Text-to-SQLText-to-SQL Evaluation