FATO-SQL: a comprehensive framework for high-performance Text-to-SQL task

yongnan chen, Shijia Gu, Zixiang He · 2024

Text-to-SQL tasks aim to bridge the gap between natural language questions and SQL queries, enabling efficient interaction with databases without the need for expertise in SQL coding. In this paper, we introduce FATO-SQL, a novel Large Language Model (LLM)-based framework designed for medium-scale LLMs to generate complex SQL queries. FATO-SQL leverages the Retrieval-Augmented Generation (RAG), prompting engineering, and two rounds of LLM calls for SQL generation and diverse response generation. We implemented FATO-SQL using production data from the petrochemical industry, testing it with multiple tables joins and multi-level nested SQL queries. Results show that FATO-SQL achieves an overall accuracy of 94% on 40 testing questions. The FATO-SQL framework demonstrates promising potential for practical industrial applications, highlighting its efficacy and adaptability in real-world scenarios.

Read the paper · More papers on PaperTik