TCSR‐SQL: Towards Table Content‐Aware Text‐to‐SQL With Self‐Retrieval

ABSTRACT Large language model‐based (LLM‐based) text‐to‐SQL methods have achieved important progress in generating SQL queries for real‐world applications. When confronted with table content‐aware questions in real‐world scenarios, ambiguous data content keywords and nonexistent database schema column names within the question lead to the poor performance of existing methods. To solve this problem, we propose a novel approach towards table content‐aware text‐to‐SQL with self‐retrieval (TCSR‐SQL). It leverages LLM's in‐context learning capability to extract data content keywords within the question and infer possible related database schema, which is used to generate Seed SQL to fuzz search databases. The search results are further used to confirm the encoding knowledge with the designed encoding knowledge table, including column names and exact stored content values used in the SQL. The encoding knowledge is sent to obtain the final Precise SQL following multi‐rounds of generation‐execution‐revision process. To validate our approach, we introduce a table‐content‐aware, question‐related benchmark dataset, containing 2115 question‐SQL pairs. Comprehensive experiments conducted on this benchmark demonstrate the remarkable performance of TCSR‐SQL, achieving an improvement of at least 27.8% in execution accuracy compared to other state‐of‐the‐art methods.

Authors

Institutions

Publication Details

Journal
CAAI Transactions on Intelligence Technology
Published
2025-11-05
DOI
https://doi.org/10.1049/cit2.70071
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

TCSR‐SQL: Towards Table Content‐Aware Text‐to‐SQL With Self‐Retrieval

Yong Xu, Bob Zhang, Haifeng Zhu, Chuanyi Liu et al.
CAAI Transactions on Intelligence Technology
Topic Modeling
article

TCSR‐SQL: Towards Table Content‐Aware Text‐to‐SQL With Self‐Retrieval

Yong Xu, Bob Zhang, Haifeng Zhu, Chuanyi Liu, Wenbo Xu, Yan Liang, Peiyi Han, Yingwei Liang
article en

Abstract

ABSTRACT Large language model‐based (LLM‐based) text‐to‐SQL methods have achieved important progress in generating SQL queries for real‐world applications. When confronted with table content‐aware questions in real‐world scenarios, ambiguous data content keywords and nonexistent database schema column names within the question lead to the poor performance of existing methods. To solve this problem, we propose a novel approach towards table content‐aware text‐to‐SQL with self‐retrieval (TCSR‐SQL). It leverages LLM's in‐context learning capability to extract data content keywords within the question and infer possible related database schema, which is used to generate Seed SQL to fuzz search databases. The search results are further used to confirm the encoding knowledge with the designed encoding knowledge table, including column names and exact stored content values used in the SQL. The encoding knowledge is sent to obtain the final Precise SQL following multi‐rounds of generation‐execution‐revision process. To validate our approach, we introduce a table‐content‐aware, question‐related benchmark dataset, containing 2115 question‐SQL pairs. Comprehensive experiments conducted on this benchmark demonstrate the remarkable performance of TCSR‐SQL, achieving an improvement of at least 27.8% in execution accuracy compared to other state‐of‐the‐art methods.

CAAI Transactions on Intelligence TechnologyVol. 11(1)
Shenzhen Institute of Information Technology (CN), University of Macau (MO), Harbin Institute of Technology (CN), Peng Cheng Laboratory (CN), Inspur (China) (CN), China Southern Power Grid (China) (CN)
National Key Research and Development Program of China
Openalex Percentile: Top 83%
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.