Lune

SIGMOD2025Top-tier venue

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL cites Exploring Unexplored Generalization Challenges for Cross-Database Semantic Parsing
  • TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database Queries cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database Queries cites CodeS: Towards Building Open-source Language Models for Text-to-SQL
  • DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning cites RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL
  • DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning cites CodeS: Towards Building Open-source Language Models for Text-to-SQL
  • A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema Databases cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema Databases cites CodeS: Towards Building Open-source Language Models for Text-to-SQL
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL
  • Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL cites RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL cites DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
  • Accurate Table Question Answering with Accessible LLMs cites Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. 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
  2. ScaleDoc: Scaling LLM-based Predicates over Large Document CollectionsHengrui Zhang, Yulong Hui, Yihao Liu, Huanchen ZhangSIGMOD 2026 · 2 citations
  3. 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
  4. Accurate Table Question Answering with Accessible LLMsYangfan Jiang, Fei Wei, Ergute Bao, Yaliang Li et al.ICDE 2026 · 1 citation
  5. A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema DatabasesKyle Luoma, Arun KumarVLDB 2026

Builds on12

  1. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
  2. Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
  3. RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLHaoyang Li, Jing Zhang, Cuiping Li, Hong ChenAAAI 2023 · 343 citations
  4. CodeS: Towards Building Open-source Language Models for Text-to-SQLHaoyang Li, Jing Zhang, Hanbing Liu, Ju Fan et al.SIGMOD 2024 · 124 citations
  5. Exploring Unexplored Generalization Challenges for Cross-Database Semantic ParsingAlane Suhr, Ming-Wei Chang, Peter Shaw, Kenton LeeACL 2020 · 76 citations

Related papers

  1. NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL SolutionsShizheng Hou, Wenqi Pei, Nuo Chen, Quang-Trung Ta et al.VLDB 2026 · 1 citation
  2. EVOSCHEMA: TOWARDS TEXT-TO-SQL ROBUSTNESS AGAINST SCHEMA EVOLUTIONTianshu Zhang, Kun Qian, Siddhartha Sahai, Yuan Tian et al.VLDB 2025 · 3 citations
  3. SPENCE: A Syntactic Probe for Detecting Contamination in NL2SQL BenchmarksMohammadtaher Safarzadeh, Hitesh Laxmichand Patel, Afshin Oroojlooy, Graham Horwood et al.ACL 2026
  4. Validating LLM-Generated SQL Queries through Metamorphic PromptingLi Lin, Qinglin Zhu, Jintai Hong, Chong Wang et al.FSE 2026
  5. The Power of Constraints in Natural Language to SQL TranslationTonghui Ren, Chen Ke, Yuankai Fan, Yinan Jing et al.VLDB 2025 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines