## 2 Related Work  
### Research Status  
After significant contributions from numerous experts and scholars and a long period of evolution, the NL2 SQL field has seen considerable progress. From an algorithmic perspective, NL2 SQL methods have evolved through rule-based approaches, neural network-based approaches, pre-trained models, and large language models (LLMs), each playing a unique role in its respective era. Rule-based methods rely on predefined rules or semantic parsers [6]. For example, NaLIR [7] translates natural language queries into SQL with a special parser and predefined rules. However, there are a lot of limitations in adaptability, scalability, and generalization, making them difficult to apply broadly. Researchers overcome these limitations with neural networks. Advances in deep neural networks have driven progress in text-to-SQL [8], automatically learning mappings from user questions to corresponding SQL. Some models employ an encoder and encode mechanism to finish NL2 SQL. With Transformer [9] and  
Figure 1: Typical workflow diagram of NL2 SQL applications on the edge-cloud computing platform. Business users give the query. NL2 SQL engine translates to SQL according to semantic lab, financial data model, and database. the Spider dataset coming, neural network-based methods win in the field [10]. Pre-trained language models (PLMs), like BERT and T5 [11], became a new paradigm for text-to-SQL systems, demonstrating state-of-the-art results on benchmark datasets. The rise of ChatGPT, GPT-4, and GPT-4o has profoundly transformed NL2 SQL solutions, with LLM-based methods significantly advancing the field [11]. Generally, LLM-based approaches involve either in-context learning (ICL) [12] or fine-tuning (FT) [13], achieving high accuracy through carefully designed frameworks and stronger comprehension than PLMs. For example, DAIL-SQL [14] obtained nice results on the Spider dataset based on GPT-4. CHASE-SQL [15], which uses Gemini and prompt engineering, also achieved high scores on the BIRD dataset. From NL2 SQL's evolution, we can expect LLM- and PLM-based methods to keep on winning the next decade in the area, with LLM-based methods particularly favored by researchers. Therefore, understanding the characteristics of these approaches is essential. Applying LLMs to NL2 SQL typically involves two main methods: in-context learning and fine-tuning LLMs. In-context learning is a technique in which the LLM performs tasks by providing contextual examples [16]. In this approach, the model does not require explicit parameter updates or retraining but is instead guided by directly supplying contextual information for the task. This method leverages the latent abilities of large language models learned from large-scale data, enabling them to infer the appropriate task based on context [17]. A well-designed prompt could help LLMs to work efficiently. Representative prompting methods include RAG [18], few-shot learning [19], and reasoning [20]. RAG involves using inputs to retrieve relevant and up-to-date documents and then constructing prompts with the connected documents and inputs [21]. With RAG, LLMs can acquire recent knowledge, improve response interpretability, and partially avoid hallucinations. Few-shot learning is a machine learning method that aims to learn new tasks or classes with only a few training samples. Compared to traditional machine learning methods, which typically require large amounts of labeled data, few-shot learning significantly reduces data needs and maintains good performance even with limited data. Finally, researchers have discovered LLM's reasoning capabilities [22], where reasoning refers to guiding an LLM to perform multi-step reasoning through prompting. This approach uses language models to generate coherent, logical steps, helping complete complex tasks like mathematical problems, logical reasoning, and common-sense questions [23].