|
# Overview |
|
|
|
**refined-sql-create-context** is a high-quality dataset for training and evaluating Text-to-SQL models. It builds upon the [**sql-create-context**](https://huggingface.co/datasets/b-mc2/sql-create-context) dataset by ensuring that all SQL queries are executable in a MySQL database, resolving schema inconsistencies, and refining query validity. The dataset consists of natural language questions, their corresponding table schemas, and SQL queries that generate results from the given schema context with 11,632 examples. |
|
|
|
## Supported Tasks and Use Cases |
|
This dataset is designed for the **Text-to-SQL** task, enabling models to generate SQL queries from natural language inputs while ensuring that queries are executable and adhere to correct syntax. It is useful for: |
|
- **Fine-tuning large language models (LLMs)** for SQL query generation |
|
- **Benchmarking Text-to-SQL performance** on a high-quality dataset |
|
- **Evaluating SQL query correctness and execution feasibility** |
|
|
|
## Dataset Structure |
|
Each sample in the dataset consists of: |
|
- `question`: A natural language query |
|
- `context`: Table schemas in SQL (`CREATE TABLE` statements) |
|
- `answer`: The corresponding SQL query |
|
|
|
### Example |
|
```json |
|
{ |
|
"question": "Please show the themes of competitions with host cities having populations larger than 1000.", |
|
"context": "CREATE TABLE city (City_ID VARCHAR, Population INTEGER); CREATE TABLE farm_competition (Theme VARCHAR, Host_city_ID VARCHAR);", |
|
"answer": "SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000" |
|
} |
|
``` |
|
|
|
Citing this work |
|
```python |
|
@article{your_citation, |
|
title={refined-sql-create-context Dataset}, |
|
author={MertML}, |
|
year={2025}, |
|
} |
|
``` |