SNAILS: Schema Naming Assessments for Improved LLM-Based SQL Inference
Kyle Luoma, Arun Kumar
Abstract
Large Language Models (LLMs) have revolutionized Natural Language to SQL (NL-to-SQL), dominating most NL-to-SQL benchmarks. But LLMs still face limitations due to hallucinations, semantic ambiguity, and lexical mismatches between an NL query and the database schema. Naturally, a lot of work in the ML+DB intersection aims to mitigate such LLM limitations. In this work, we shine the light on a complementary data-centric question: How should DB schemas evolve in this era of LLMs to boost NL-to-SQL? The intuition is that more NL-friendly schema identifiers can help LLMs work better with DBs. We dive deeper into this seemingly obvious, but hitherto underexplored and important, connection between schema identifier ''naturalness'' and the behavior of LLM-based NL-to-SQL by creating a new integrated benchmark suite we call SNAILS. SNAILS has 4 novel artifacts: (1) A collection of real-world DB schemas not present in prior NL-to-SQL benchmarks; (2) A set of labeled NL-SQL query pairs on our collection not seen before by public LLMs; (3) A notion of naturalness level for schema identifiers and a novel labeled dataset of modified identifiers; and (4) AI artifacts to automatically modify identifier naturalness. Using SNAILS, we perform a comprehensive empirical evaluation of the impact of schema naturalness on LLM-based NL-to-SQL accuracy, and present a method for improving LLM-based NL-to-SQL with natural views. Our results reveal statistically significant correlations across multiple public LLMs from OpenAI, Meta, and Google on multiple databases using both zero-shot prompting as well as more complex NL-to-SQL workflows: DIN SQL, and CodeS. We present several fine-grained insights and discuss pathways for DB practitioners to better exploit LLMs for NL-to-SQL.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers7
- DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence ReasoningYafeng Nan, Haifeng Sun, Zirui Zhuang, Qi Qi et al.SIGMOD 2026 · 3 citations
- ScaleDoc: Scaling LLM-based Predicates over Large Document CollectionsHengrui Zhang, Yulong Hui, Yihao Liu, Huanchen ZhangSIGMOD 2026 · 2 citations
- TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database QueriesChao Deng, Ju Fan, Yuyu Luo, Qinliang Xue et al.VLDB 2026 · 1 citation
- Accurate Table Question Answering with Accessible LLMsYangfan Jiang, Fei Wei, Ergute Bao, Yaliang Li et al.ICDE 2026 · 1 citation
- A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema DatabasesKyle Luoma, Arun KumarVLDB 2026
Builds on12
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
- Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
- RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLHaoyang Li, Jing Zhang, Cuiping Li, Hong ChenAAAI 2023 · 343 citations
- CodeS: Towards Building Open-source Language Models for Text-to-SQLHaoyang Li, Jing Zhang, Hanbing Liu, Ju Fan et al.SIGMOD 2024 · 124 citations
- Exploring Unexplored Generalization Challenges for Cross-Database Semantic ParsingAlane Suhr, Ming-Wei Chang, Peter Shaw, Kenton LeeACL 2020 · 76 citations
Related papers
- NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL SolutionsShizheng Hou, Wenqi Pei, Nuo Chen, Quang-Trung Ta et al.VLDB 2026 · 1 citation
- EVOSCHEMA: TOWARDS TEXT-TO-SQL ROBUSTNESS AGAINST SCHEMA EVOLUTIONTianshu Zhang, Kun Qian, Siddhartha Sahai, Yuan Tian et al.VLDB 2025 · 3 citations
- SPENCE: A Syntactic Probe for Detecting Contamination in NL2SQL BenchmarksMohammadtaher Safarzadeh, Hitesh Laxmichand Patel, Afshin Oroojlooy, Graham Horwood et al.ACL 2026
- The Power of Constraints in Natural Language to SQL TranslationTonghui Ren, Chen Ke, Yuankai Fan, Yinan Jing et al.VLDB 2025 · 4 citations
- PURPLE: Making a Large Language Model a Better SQL WriterTonghui Ren, Yuankai Fan, Zhenying He, Ren Huang et al.ICDE 2024 · 49 citations
