File size: 6,232 Bytes
736d46c c500ca0 736d46c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | ---
license: cc-by-sa-4.0
task_categories:
- table-question-answering
- text-generation
language:
- en
tags:
- text-to-sql
- nl2sql
- supply-chain
- erp
- odoo
- multi-turn
- domain-specific
pretty_name: SCM-SQL
size_categories:
- n<1K
source_datasets:
- original
paperswithcode_id: null
---
# SCM-SQL — a supply-chain natural-language-to-SQL evaluation set
**500 (question, gold SQL) pairs authored against the live Odoo 17 supply-chain
schema, spanning 6 explicit complexity levels including multi-turn dialogues.**
Built for the dissertation *Domain-Aware Multi-Agent Natural-Language-to-SQL for
Enterprise Supply Chain Intelligence* by Aniruddha Prakash Kawarase (BITS Pilani
WILP, 2026). Released as a public evaluation benchmark so other researchers can
compare domain-aware text-to-SQL systems on realistic enterprise-ERP queries.
## Why this dataset exists
Public text-to-SQL benchmarks like [BIRD](https://bird-bench.github.io) and
[Spider](https://yale-lily.github.io/spider) are open-domain: they test whether
a model generalises across many small schemas (typically 3-6 tables per
database). Enterprise supply-chain deployments look different: one deep
schema, many tables, dialect quirks, and analysts who iterate on their
questions over multiple turns. SCM-SQL is designed to stress-test that
enterprise setting.
## What's in the box
- **500 (question, gold SQL) pairs** — `data/pilot_500.yaml`
- **6 explicit complexity levels** — L1 (single-table filter) → L6 (multi-turn refinement)
- **4 supply-chain sub-domain tags** — demand, finance, inventory, logistics
- **Every gold SQL is execute-verified** against a stock Odoo 17 demo database
- **Multi-turn dialogues** — 50 L6 pairs consist of 2-3 turns each where turn N refines the SQL of turn N-1
### Distribution
| Level | Style | n | Multi-turn? |
|-------|-------|---|---|
| L1 | Single-table filter or aggregate | 100 | No |
| L2 | Two-table JOIN + GROUP BY | 100 | No |
| L3 | Nested subquery / semi-join / 3-table join | 130 | No |
| L4 | Window function | 60 | No |
| L5 | CTE + rollup / GROUPING SETS | 60 | No |
| L6 | Multi-turn conversational refinement | 50 | Yes (2-3 turns each) |
| **Total** | | **500** | **556 turn-level trials** |
Per-domain (a pair can carry multiple domain tags):
| Domain | Approx. count |
|--------|---------------|
| demand | ~ 145 |
| finance | ~ 140 |
| inventory | ~ 130 |
| logistics | ~ 130 |
## Target database
Every gold SQL is executable on **stock Odoo 17** (image
`odoo:17.0` from Docker Hub, unmodified). The Odoo demo dataset ships with
approximately 42 000 rows across 498 tables and is fetched by
`docker compose up` on the reference implementation.
**No modification is made to the Odoo demo data itself.** SCM-SQL is a new
artefact authored *on top of* the Odoo schema — it does not fork, edit, or
redistribute the underlying Odoo data.
## Loading
**With `datasets`:**
```python
from datasets import load_dataset
ds = load_dataset("AniruddhaAI/scm-sql", split="test")
print(ds[0])
```
**Directly from YAML:**
```python
import yaml
with open("data/pilot_500.yaml") as f:
pairs = yaml.safe_load(f)["pairs"]
print(len(pairs), "pairs")
print(pairs[0])
```
See `examples/` for full loader and evaluation-harness snippets.
## Schema
Every pair is a YAML document with the following fields:
| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Unique identifier, e.g. `L1-001`, `L6-023` |
| `level` | int (1-6) | Complexity tier |
| `domains` | list[string] | One or more of `demand`, `finance`, `inventory`, `logistics` |
| `nl` | string | (L1-L5 only) The natural-language question |
| `gold_sql` | string | (L1-L5 only) The verified gold PostgreSQL statement |
| `turns` | list | (L6 only) Sequence of `{nl, gold_sql}` turns; turn N refines turn N-1 |
| `tags` | list[string] | Intent tags (`aggregate`, `filter`, `join`, `window`, `cte`, `multi_turn`, ...) |
Full schema documentation with examples: [`docs/SCHEMA.md`](docs/SCHEMA.md).
## Evaluation protocol
SCM-SQL follows the **Execution Accuracy (EX)** protocol standard in the
text-to-SQL literature: a predicted SQL is counted correct if and only if
executing it against the target Odoo database produces a row-equivalent
result set to the gold SQL (order-agnostic, column-name-agnostic row
multiset comparison).
An additional metric, **Soft-EX**, absorbs benign alias renames: a
prediction returning `revenue` where the gold returns `total_revenue`
still counts as correct as long as the row-values match.
See `examples/evaluate_predictions.py` for a reference implementation.
## Modifications to source datasets
**None.** SCM-SQL is a new artefact, not a fork of any existing dataset.
The Odoo 17 demo database itself is unchanged — no `INSERT`, `UPDATE`, or
`DELETE` statement is ever issued against it. The reference implementation
runs against the stock `odoo:17.0` Docker image, verifiable by pulling with
digest pinning.
## Companion project
The reference multi-agent NL-to-SQL implementation that this dataset was
built to evaluate lives at:
**https://github.com/AniruddhaPKawarase/scm-nl2sql**
That repository contains a LangGraph orchestrator (Router · Specialist ·
Composer · Compliance · Executor), a Next.js UI with live evaluation-metric
chips, and the full evaluation harness (`scripts/run_evaluation.py`) that
computes EX / Soft-EX / VES on this dataset.
## License
**CC BY-SA 4.0** — attribution + share-alike. This matches the licences
under which BIRD and Spider are released, so mixed benchmarking is
licence-consistent.
## Citation
If you use SCM-SQL in your research, please cite:
```bibtex
@misc{kawarase2026scmsql,
title = {SCM-SQL: A Supply-Chain Natural-Language-to-SQL Evaluation Set},
author = {Kawarase, Aniruddha Prakash},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/AniruddhaAI/scm-sql}},
note = {Companion repository: https://github.com/AniruddhaPKawarase/scm-nl2sql}
}
```
See [`CITATION.cff`](CITATION.cff) for the machine-readable citation file.
## Contact
Aniruddha Prakash Kawarase · BITS Pilani WILP · aniruddhakawarase@gmail.com
|