Text-to-SQL systems translate natural language questions into SQL queries, providing substantial value for non-expert users. While large language models (LLMs) show promising results for this task, they remain error-prone. Query ambiguity has been recognized as a major obstacle in LLM-based Text-to-SQL systems, leading to misinterpretation of user intent and inaccurate SQL generation. To this end, we present AmbiSQL, an interactive system that automatically detects query ambiguities and guides users through intuitive multiple-choice questions to clarify their intent. It introduces a fine-grained ambiguity taxonomy for identifying ambiguities arising from both database elements and LLM reasoning, and subsequently incorporates user feedback to rewrite ambiguous questions. In this demonstration, AmbiSQL is integrated with XiYan-SQL, our commercial Text-to-SQL backend. We provide 40 ambiguous queries collected from two real-world benchmarks that SIGMOD'26 attendees can use to explore how disambiguation improves SQL generation quality. Participants can also apply the system to their own databases and natural language questions. The codebase and demo video are available at: https://github.com/JustinzjDing/AmbiSQL and https://www.youtube.com/watch?v=rbB-0ZKwYkk.
翻译:文本到SQL系统将自然语言问题转换为SQL查询,为非专业用户提供了重要价值。尽管大型语言模型在完成该任务时展现出令人期待的结果,但仍存在易错性。查询歧义已被认为是基于LLM的文本到SQL系统的主要障碍,导致用户意图误解与SQL生成错误。为此,我们提出AmbiSQL——一个交互式系统,可自动检测查询歧义,并通过直观的多选题引导用户澄清其意图。该系统引入细粒度歧义分类体系,用以识别源自数据库元素与LLM推理两方面的歧义,进而整合用户反馈以重写歧义问题。在本次演示中,AmbiSQL已集成至商业文本到SQL后端XiYan-SQL。我们提供了从两个真实基准测试中收集的40个歧义查询,SIGMOD'26与会者可借此探索消歧如何提升SQL生成质量。参与者亦可针对自有数据库和自然语言问题应用该系统。代码库与演示视频获取地址:https://github.com/JustinzjDing/AmbiSQL 及 https://www.youtube.com/watch?v=rbB-0ZKwYkk。