lorinma/NL2SQL_zh
收藏资源简介:
--- language: - zh --- 整合了3个中文数据集:追一科技NL2SQL,西湖大学的CSpider中文翻译,百度的DuSQL。 进行了大致的清洗,以及格式转换(alpaca): 假设你是一个数据库SQL专家,下面我会给出一个MySQL数据库的信息,请根据问题,帮我生成相应的SQL语句。当前时间为2023年。格式如下:{'sql':sql语句} MySQL数据库数据库结构如下:\n{表名(字段名...)}\n 其中:\n{表之间的主外键关联关系}\n 对于query:“{问题}”,给出相应的SQL语句,按照要求的格式返回,不进行任何解释。 其中,DuSQL最终结果是25004个。NL2SQL最终结果45919个,注意表名是乱码。CSpider,最终结果7786条,注意数据库是英文的,问题是中文的。 最终形成的文件,一共78706条,文件样例: ``` { "instruction": "假设你是一个数据库SQL专家,下面我会给出一个MySQL数据库的信息,请根据问题,帮我生成相应的SQL语句。当前时间为2023年。", "input": "MySQL数据库数据库结构如下:Table_f367fd66453d11e9bdc9f40f24344a08(序号, 检验报告号, 商品名称, 标称生产者名称, 标称商标, 型号(货号))。对于问题:“我想知道纯琦服饰生产的呢子风衣的检验结果如何,麻烦给我它的报告号”,给出相应的SQL语句,不进行任何解释。", "output": "SELECT 检验报告号 WHERE 标称生产者名称 == \"纯琦服饰有限公司\" and 商品名称 == \"呢子风衣\"" }, ```
language: - zh This dataset integrates three Chinese datasets: Zhuiyi Technology's NL2SQL, the Chinese translated version of CSpider from Westlake University, and Baidu's DuSQL. Preliminary cleaning and format conversion to the Alpaca format have been conducted. The task instruction is as follows: Assume you are a database SQL expert. I will provide the schema information of a MySQL database, please generate the corresponding SQL statement based on the given question. The current year is 2023. The required output format is: {'sql': <SQL_statement>} The detailed input format is: The schema of the target MySQL database is as follows: {table_name (field_name1, field_name2, ...)} The primary and foreign key relationships between tables are: {table relationship details} For the query: "{question}", generate the corresponding SQL statement and return it in the required format without any additional explanations. Specifically, the final processed samples are 25,004 for DuSQL, 45,919 for NL2SQL (note that the table names in this subset are garbled), and 7,786 for CSpider (note that the database schema is in English while the questions are in Chinese). The final compiled dataset contains a total of 78,706 samples. A sample entry is as follows: { "instruction": "You are a database SQL expert. I will provide you with the schema information of a MySQL database. Please generate the corresponding SQL statement based on the given question. The current year is 2023.", "input": "The schema of the target MySQL database is as follows: Table_f367fd66453d11e9bdc9f40f24344a08 (Serial Number, Inspection Report Number, Product Name, Nominal Manufacturer Name, Nominal Trademark, Model (Item Number)). For the question: "I would like to know the inspection results of the woolen coat produced by Chunqi Clothing, please provide its report number.", generate the corresponding SQL statement without any additional explanations.", "output": "SELECT `检验报告号` FROM Table_f367fd66453d11e9bdc9f40f24344a08 WHERE `标称生产者名称` = 'Chunqi Clothing Co., Ltd.' AND `商品名称` = 'woolen coat'" }
数据集概述
数据集来源
- 整合了3个中文数据集:追一科技NL2SQL,西湖大学的CSpider中文翻译,百度的DuSQL。
数据清洗与格式转换
- 进行了大致的清洗,以及格式转换(alpaca)。
数据集描述
- DuSQL最终结果是25004个。
- NL2SQL最终结果45919个,注意表名是乱码。
- CSpider,最终结果7786条,注意数据库是英文的,问题是中文的。
数据集规模
- 最终形成的文件,一共78706条。
数据样例
json { "instruction": "假设你是一个数据库SQL专家,下面我会给出一个MySQL数据库的信息,请根据问题,帮我生成相应的SQL语句。当前时间为2023年。", "input": "MySQL数据库数据库结构如下:Table_f367fd66453d11e9bdc9f40f24344a08(序号, 检验报告号, 商品名称, 标称生产者名称, 标称商标, 型号(货号))。对于问题:“我想知道纯琦服饰生产的呢子风衣的检验结果如何,麻烦给我它的报告号”,给出相应的SQL语句,不进行任何解释。", "output": "SELECT 检验报告号 WHERE 标称生产者名称 == "纯琦服饰有限公司" and 商品名称 == "呢子风衣"" }




