🕸️ Text-to-SQL
Collection
2 items • Updated
messages listlengths 3 3 |
|---|
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
[
{
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.",
"role": "system"
},
{
"content": "### Database Schema\nCREATE TABLE \"lists\"\n(\n user_id INTEGER\n refer... |
BIRD(BIg Bench for Large-Scale Database Grounded Text-to-SQL)訓練集的 OpenAI Messages 格式版本,供 Text-to-SQL 模型 Supervised Fine-Tuning(SFT)使用。
本資料集完全衍生自 BIRD benchmark 官方訓練集,原始資料集由香港大學與微軟研究院聯合建立:
本資料集不修改任何原始問題、SQL、evidence 或資料庫 schema 內容,僅將格式轉換為 OpenAI Messages 格式(system / user / assistant)以利 SFT 訓練。Schema 從原始 BIRD 官方提供的 SQLite 資料庫中萃取。
| 項目 | 數值 |
|---|---|
| 筆數 | 9,428 |
| 來源 split | BIRD train |
| 資料庫數量 | 70 個(真實資料庫) |
| 領域數量 | 37+ 個 |
| 特色 | 含 evidence(數值提示)欄位,放入 ### Hint |
| 格式 | Parquet,OpenAI Messages |
| 模型 | 機構 | 使用方式 |
|---|---|---|
| OmniSQL | Renmin University | SFT 訓練資料之一(與 SynSQL-2.5M + Spider 合併) |
| XiYan-SQL | Alibaba | Stage 1 + Stage 2 SFT 訓練資料,含多方言版本 |
| CodeS | RUC (SIGMOD 2024) | Spider train + BIRD train SFT |
| CHESS | Stanford | 訓練 Schema Selector 與 SQL Generator |
| Arctic-Text2SQL-R1 | Snowflake | 透過 OmniSQL checkpoint 間接使用;GRPO RL 亦使用 BIRD train |
BIRD 特有的 evidence 欄位作為 ### Hint 放入 user prompt:
{
"messages": [
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE ...\n\n### Question\nWhat is the average age?\n\n### Hint\nage refers to column `birth_year`"
},
{
"role": "assistant",
"content": "SELECT AVG(birth_year) FROM person"
}
]
}
無 evidence 的樣本則省略 ### Hint 區塊。
from datasets import load_dataset
ds = load_dataset("lianghsun/bird-text2sql-sft", split="train")
print(ds[0]["messages"])
本資料集依照原始 BIRD 資料集授權條款釋出,採用 CC BY-SA 4.0,並需遵守 BIRD 官方使用條款。
使用本資料集請同時引用原始 BIRD 論文:
@inproceedings{li2023bird,
title = {Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs},
author = {Li, Jinyang and Hui, Binyuan and Qu, Ge and Yang, Jiaxi and Li, Binhua and Li, Bowen and Wang, Bailin and Qin, Bowen and Geng, Ruiying and Huo, Nan and others},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS 2023)},
year = {2023}
}