Translating Natural Language Queries into Structured Query Language (Text-to-SQL or NLQ-to-SQL) is a critical task extensively studied by both the natural language processing and database communities, aimed at providing a natural language interface to databases (NLIDB) and lowering the barrier for non-experts. Despite recent advancements made through the use of Large Language Models (LLMs), significant challenges remain. These include handling complex database schemas, resolving ambiguity in user queries, and generating SQL queries with intricate structures that accurately reflect the user's intent. In this work, we introduce E-SQL, a novel pipeline specifically designed to address these challenges through direct schema linking and candidate predicate augmentation. E-SQL enhances the natural language query by incorporating relevant database items (i.e., tables, columns, and values) and conditions directly into the question and SQL construction plan, bridging the gap between the query and the database structure. The pipeline leverages candidate predicate augmentation to mitigate erroneous or incomplete predicates in generated SQLs. Comprehensive evaluations on the BIRD benchmark illustrate that E-SQL achieves competitive performance, particularly excelling in complex queries with a 66.29% execution accuracy on the test set. A further observation from our experiments reveals that incorporating schema filtering into the translation pipeline does not have a positive impact on performance when the most advanced proprietary LLMs are used. Additionally, our experiments with small LLMs highlight the importance and positive impact of enriched questions on their performance. Without fine-tuning, single-prompt SQL generation using enriched questions with DeepSeek Coder 7B Instruct 1.5v achieves 56.45% execution accuracy on the BIRD development set.
University of Chinese Academy of Sciences(中国科学院大学);Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);Alibaba Group(阿里巴巴集团);Massachusetts Institute of Technology(麻省理工学院)
The importance of building text-to-SQL parsers which can be applied to new databases has long been acknowledged, and a critical step to achieve this goal is schema linking, i.e., properly recognizing mentions of unseen columns or tables when generating SQLs. In this work, we propose a novel framework to elicit relational structures from large-scale pre-trained language models (PLMs) via a probing procedure based on Poincaré distance metric, and use the induced relations to augment current graph-based parsers for better schema linking. Compared with commonly-used rule-based methods for schema l…
Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents
School of Computer Science, Northwestern Polytechnical University(西北工业大学计算机学院);Big Data Shortage and Management, MIIT(工业和信息化部大数据短缺与管理局);School of Computing, National University of Singapore(新加坡国立大学计算机学院);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算与信息系统学院)
DCG-SQL: Enhancing In-Context Learning for Text-to-SQL with Deep Contextual Schema Link Graph
Department of Artificial Intelligence, Sungkyunkwan University(人工智能系,成均馆大学);Department of Immersive Media Engineering, Sungkyunkwan University(沉浸媒体工程系,成均馆大学);Department of Computer Science and Engineering, Sungkyunkwan University(计算机科学与工程系,成均馆大学)
ProSPy: A Profiling-Driven SQL-Python Agentic Framework for Enterprise Text-to-SQL
State Key Lab of CAD&CG(计算机辅助设计与图形学国家重点实验室);School of Software Technology(软件技术学院);Tencent TEG(腾讯科技集团);School of Mathematical Sciences, Peking University(北京大学数学科学学院);Zhejiang University(浙江大学)
PET-SQL: A Prompt-Enhanced Two-Round Refinement of Text-to-SQL with Cross-consistency
SenseTime Research(商汤科技研究院);Peking University(北京大学);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);School of Computer Science and Technology, Beijing Institute of Technology(北京理工大学计算机学院);University of Cologne(科隆大学)
Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generation
School of Computer Science, Guangdong University of Technology(广东工业大学计算机科学学院);College of Science, Shantou University(汕头大学科学学院);Peng Cheng Laboratory(鹏城实验室)
ErrorLLM: Modeling SQL Errors for Text-to-SQL Refinement
The Hong Kong Polytechnic University(香港理工大学);City University of Macau(澳门城市大学);Jilin University(吉林大学);Harbin Institute of Technology (Shenzhen)(哈尔滨工业大学(深圳));Beihang University(北航大学)
DBCopilot: Natural Language Querying over Massive Databases via Schema Routing
Institute of Software, CAS(中国科学院软件研究所);Hangzhou Institute for Advanced Study, UCAS(中国科学院大学杭州高等研究院);University of Chinese Academy of Sciences (UCAS)(中国科学院大学);Alibaba Cloud Intelligence Group(阿里巴巴云智能集团)
Enhancing Text-to-SQL Capabilities of Large Language Models via Domain Database Knowledge Injection
School of Cyber Science Engineering, Huazhong University of Science and Technology(华中科技大学网络空间科学与工程学院);Wuhan AI Research Foundation Model Research Center(武汉人工智能研究基金会大模型研究中心);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Peng Cheng Laboratory(鹏城实验室)
In this work, we present X-SQL, a new network architecture for the problem of parsing natural language to SQL query. X-SQL proposes to enhance the structural schema representation with the contextual output from BERT-style pre-training model, and together with type information to learn a new schema representation for down-stream tasks. We evaluated X-SQL on the WikiSQL dataset and show its new state-of-the-art performance.