SQLC2: Correction Method Based on SQL Classification in Text-to-SQL Enhanced by LLMs

Authors: Xinzhe Ge,Shaopeng Wang
Conference: ICIC 2025 Posters, Ningbo, China, July 26-29, 2025
Pages: -
Keywords: Text-to-SQL, Prompt Learning, Correction.

Abstract

Text-to-SQL tasks involves translating a natural language NL question into a corresponding and valid Structured Query Language SQL query that can be executed over a database. Text-to-SQL enables users who may not be fa-miliar with SQL or the structure of a database to interact with the database using natural language. With the advent of large language models LLMs , prompting-based approaches have become a new paradigm for Text-to-SQL tasks. However, the research on SQL query correction in existing prompting-based Text-to-SQL tasks is not enough. Therefore, this paper introduces a novel method, namely SQLC2 SQL query correction based on classifica-tion . This method is realized by using prompting-based in the LLMs scenar-io. SQLC2 classifies the output of Text-to-SQL tasks based on the structure of SQL queries. Subsequently, it applies corresponding corrections to SQL queries according to their class labels. We evaluate SQLC2 on the popular Text-to-SQL benchmarks Spider datasets. The experiment results show that the SQLC2 method improves the performance of existing methods.
📄 View Full Paper (PDF) 📋 Show Citation