## 1 Introduction  
The goal of the text-to-SQL task is to translate natural language questions into their corresponding SQL queries. Querying relational databases, which are knowledge bases that require specific SQL statements, poses a challenge for non-experts. Consequently, the ability to query databases by using natural language has attracted many users unfamiliar with SQL, enabling them to access large databases. Many neural methods have been proposed to address this task [1, 2]. Large datasets containing natural language questions and their corresponding SQL queries have significantly advanced the development of this field. Compared with previous datasets, multi-domain datasets containing complex information, such as Spider [3] and Spider-Syn [4], present new challenges. Most queries are based on a multi-table database schema, which contains multiple levels of nesting. Since the proposal of large-scale text-to-SQL datasets, various types of relationships have been incorporated into this task. In models that incorporate relational structures, it is particularly important to encode both the question and the elements of the database schema, as well as to understand the various relationships among these heterogeneous inputs. Previous studies have employed node-centric graph neural networks (GNNs) [5] to aggregate information from neighboring nodes. For example, GNNsQL utilizes a relational graph convolutional network (RGCN) [6] to address the various types of edges within the schema elements. However, these edge features are obtained directly from a fixed-size parameter matrix, which does not aid in understanding contextual information, particularly the topological structure of the edges. Although RAT-SQL [7] introduces several useful meta-paths, it represents both one-hop and multi-hop relationships in the same way within the graph. In LGESQL [8], the incorporation of a line graph enables a distinction between one-hop and multi-hop relationships while also taking into account the topological structure of the edges, significantly improving performance on these tasks. RASAT [9] incorporates the dependency structure of natural language questions and introduces multi-head relation-aware attention into the T5 model. Although graph neural networks have been widely applied in text-to-SQL tasks, previous SQL methods have not fully leveraged the nuanced grammatical information present in sentences, leading to limitations in syntactic parsing and semantic understanding. As a result, misunderstandings of SQL query intent arose during the generation process, resulting in the creation of incorrect queries. For instance, as illustrated in Figure 1, if the method emphasizes only the main structure of the sentence, it cannot guarantee that the term \"age\" is included in the final generated SQL query. Furthermore, the model tends to perform inadequately when handling long and complex queries, demonstrating weak generalization capability. In this paper, we propose RGISQL, which integrates refined grammatical dependencies among question tokens, enabling the model to focus more intently on the crucial grammatical information inherent in the questions. To further enhance the model's performance on long queries, we implement a segmentation approach. Lastly, to boost the model's generalization capability, we reduce the complexity of edge embeddings by minimizing coupling. RGISQL also integrates recursive decoding with the ASTformer decoder during the decoding process. The experimental results indicate that utilizing a pre-trained model tailored for the preprocessing stage enables us to achieve an exact set match accuracy of 73.6% and an execution accuracy of 77.3% on the Spider dataset. This demonstrates that the SQL queries generated by RGISQL are more accurate. Additionally, we achieve an accuracy of 52.6% on Spider-Syn, highlighting a significant improvement in the model's generalization ability compared with the baseline. Furthermore, we demonstrate the effectiveness of our method through comprehensive ablation experiments.