samrat-kar/ap-sql-v1
Text Generation • Updated • 1
messages listlengths 3 3 | meta unknown |
|---|---|
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00660",
"tier": "T2",
"family": "spec-inv",
"kind": "ask",
"source": "S2-templated",
"group": "13f95602a3de",
"tables": [
"AP_INVOICES_ALL",
"AP_TERMS_B"
],
"result_rows": 5,
"approx_prompt_tokens": 2829,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint": ... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "r-00057",
"tier": "T3",
"family": "spec-inv",
"kind": "repair-exec",
"source": "S6-repair",
"group": "0c4198551d94",
"tables": [
"AP_INVOICES_ALL",
"AP_TERMS_B"
],
"result_rows": 0,
"approx_prompt_tokens": 3025,
"context_complete": true,
"missing_tables": [],
"schema_fingerpri... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-01638",
"tier": "T5",
"family": "t5-glossary",
"kind": "ask",
"source": "S2-templated",
"group": "296a523fea8c",
"tables": [
"AP_HOLDS_ALL",
"AP_INVOICES_ALL"
],
"result_rows": 1,
"approx_prompt_tokens": 3077,
"context_complete": true,
"missing_tables": [],
"schema_fingerpri... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-01196",
"tier": "T3",
"family": "spec-inv",
"kind": "ask",
"source": "S2-templated",
"group": "26bc10748867",
"tables": [
"AP_INVOICES_ALL"
],
"result_rows": 5,
"approx_prompt_tokens": 2771,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint": "a978c48ca1a87c06b... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00010",
"tier": "T1",
"family": "t1-count",
"kind": "ask",
"source": "S2-templated",
"group": "1c64a832d220",
"tables": [
"AP_INVOICES_ALL"
],
"result_rows": 1,
"approx_prompt_tokens": 2676,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint": "a978c48ca1a87c06b... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00126",
"tier": "T1",
"family": "t1-count",
"kind": "ask",
"source": "S2-templated",
"group": "a8c1702cc047",
"tables": [
"AP_INVOICES_ALL"
],
"result_rows": 1,
"approx_prompt_tokens": 2832,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint": "a978c48ca1a87c06b... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00566",
"tier": "T2",
"family": "spec-inv",
"kind": "ask",
"source": "S2-templated",
"group": "d118f138c4ee",
"tables": [
"AP_INVOICES_ALL",
"AP_TERMS_B"
],
"result_rows": 10,
"approx_prompt_tokens": 3122,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint":... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00630",
"tier": "T2",
"family": "spec-inv",
"kind": "ask",
"source": "S2-templated",
"group": "b6083d89a35f",
"tables": [
"AP_INVOICES_ALL",
"FUN_BUSINESS_UNITS"
],
"result_rows": 5,
"approx_prompt_tokens": 2609,
"context_complete": true,
"missing_tables": [],
"schema_finger... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "r-00033",
"tier": "T3",
"family": "spec-inst",
"kind": "repair-exec",
"source": "S6-repair",
"group": "9d4dc837298b",
"tables": [
"AP_INVOICES_ALL",
"AP_PAYMENT_SCHEDULES_ALL",
"POZ_SUPPLIERS"
],
"result_rows": 0,
"approx_prompt_tokens": 3350,
"context_complete": true,
"miss... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00681",
"tier": "T2",
"family": "spec-pay",
"kind": "ask",
"source": "S2-templated",
"group": "2b70d527034f",
"tables": [
"AP_CHECKS_ALL",
"POZ_SUPPLIER_ADDRESSES"
],
"result_rows": 6,
"approx_prompt_tokens": 2607,
"context_complete": true,
"missing_tables": [],
"schema_fing... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00065",
"tier": "T1",
"family": "spec-pay",
"kind": "ask",
"source": "S2-templated",
"group": "8a1df11d6c3a",
"tables": [
"AP_CHECKS_ALL"
],
"result_rows": 4,
"approx_prompt_tokens": 3009,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint": "a978c48ca1a87c06bf2... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00597",
"tier": "T2",
"family": "spec-inv",
"kind": "ask",
"source": "S2-templated",
"group": "af23b98e0a54",
"tables": [
"AP_INVOICES_ALL",
"POZ_SUPPLIER_ADDRESSES"
],
"result_rows": 5,
"approx_prompt_tokens": 2700,
"context_complete": true,
"missing_tables": [],
"schema_fi... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-01520",
"tier": "T5",
"family": "t5-glossary",
"kind": "ask",
"source": "S2-templated",
"group": "166a276da707",
"tables": [
"AP_INVOICES_ALL",
"POZ_SUPPLIERS"
],
"result_rows": 9,
"approx_prompt_tokens": 2970,
"context_complete": true,
"missing_tables": [],
"schema_fingerpr... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00808",
"tier": "T2",
"family": "spec-inv",
"kind": "ask",
"source": "S2-templated",
"group": "5e4a52ff4474",
"tables": [
"AP_INVOICES_ALL",
"AP_TERMS_B"
],
"result_rows": 5,
"approx_prompt_tokens": 2847,
"context_complete": true,
"missing_tables": [],
"schema_fingerprint": ... |
[
{
"role": "system",
"content": "You are a precise Oracle SQL generator for an Accounts Payable analytics assistant.\n\nRules:\n- Output ONLY a single read-only Oracle SQL SELECT statement that answers the user's question.\n- Respond with the SQL in a single ```sql code block and nothing else — no prose, no ... | {
"id": "a-00367",
"tier": "T2",
"family": "t2-invoice-lookup",
"kind": "ask",
"source": "S2-templated",
"group": "78deaf491a34",
"tables": [
"AP_INVOICES_ALL",
"AP_PAYMENT_SCHEDULES_ALL"
],
"result_rows": 2,
"approx_prompt_tokens": 2735,
"context_complete": true,
"missing_tables": [],
... |
A chat-format text-to-SQL dataset for Accounts Payable analytics on Oracle. The schema is modelled on Oracle Fusion
AP, Payments and Supplier tables, and the data behind it is synthetic. The dataset was used to train the LoRA adapter
samrat-kar/ap-sql-v1.
Every gold SQL query was run against the demo database when the dataset was built; meta.result_rows records how many rows it returned.
One JSON object per line:
{"messages": [{"role": "system", "content": "...rules + CREATE TABLE DDL + glossary..."},
{"role": "user", "content": "question (or follow-up / repair request)"},
{"role": "assistant", "content": "```sql\nSELECT ...\n```"}],
"meta": {"id": "...", "tier": "T1-T5", "family": "...", "kind": "ask|followup|repair-exec|repair-parse",
"source": "...", "group": "...", "tables": ["..."], "result_rows": 3, "approx_prompt_tokens": 3089, "split": "..."}}
The system prompt is the one the assistant builds at runtime: the rules, then the DDL of the retrieved tables (wide tables pruned to join keys plus the relevant columns), then the glossary entries. It is capped at about 3,584 tokens so the whole prompt fits a 4,096-token window.
| tier | train | validation | test |
|---|---|---|---|
| T1 (single table, simple) | 284 | 17 | 37 |
| T2 | 463 | 28 | 56 |
| T3 | 471 | 34 | 58 |
| T4 | 143 | 10 | 19 |
| T5 (hardest) | 80 | 6 | 9 |
| total | 1,441 | 95 | 179 |
meta.group. Paraphrases and variants of one question always land in the same split, so no test group
appears in train.ask is a plain question. followup carries conversation history. repair-exec and repair-parse
give the model a failed query and its Oracle or parse error, and the target is the corrected query.S2-templated rows are generated from templates, S6-repair rows are repair cases, and
S1-golden rows are hand-written (test split only).from datasets import load_dataset
ds = load_dataset("samrat-kar/ap-sql-peft")