arXiv:2508.07087cs.DBcs.AI2025-08中稿 · PVLDB 2026被引 2

跨数据库映射SQL查询,提升文本转SQL的准确率

SQL-Exchange: Transforming SQL Queries Across Domains

  • 保留源查询结构,适配目标数据库字段与表名
  • 映射后查询在多个数据集上执行有效且语义正确
  • 适合需要跨领域迁移的文本转SQL系统开发者

我们提出SQL-Exchange框架,通过保持源查询结构的同时,将领域特定元素适配至目标数据库模式,实现跨数据库的SQL查询映射。研究了此类映射的可行性与收益,并评估其对文本转SQL系统上下文学习性能的影响。在多模型族与基准数据集上的综合评估显示,该方法在多种模式和查询类型下均有效。结果表明,使用映射后的查询进行上下文提示或在映射数据上微调,均显著优于直接使用源模式数据的性能。

原文摘要 · Abstract (English)

We introduce SQL-Exchange, a framework for mapping SQL queries across different database schemas by preserving the source query structure while adapting domain-specific elements to align with the target schema. We investigate the conditions under which such mappings are feasible and beneficial, and examine their impact on enhancing the in-context learning performance of text-to-SQL systems as a downstream task. Our comprehensive evaluation across multiple model families and benchmark datasets -- assessing structural alignment with source queries, execution validity on target databases, and semantic correctness -- demonstrates that SQL-Exchange is effective across a wide range of schemas and query types. Our results further show that both in-context prompting with mapped queries and fine-tuning on mapped data consistently yield higher text-to-SQL performance than using examples drawn directly from the source schema.

文本转SQL跨域映射数据库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。