variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
accounts (alias: acct)(type, salary, level, status)
sales(salary, status, level, type)
Task: Retrieve salary from accounts with amount above the COUNT(value) of sales rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13500 | train |
v2 | Schema:
categories (alias: catg)(salary, code, level, name)
orders(status, salary, id, date)
Task: Find salary from categories where a matching record exists in orders with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13501 | train |
v2 | Schema:
staff (alias: empl)(salary, value, amount, type)
items(name, amount, code, type)
Task: Find value from staff where a matching record exists in items with the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13502 | train |
v2 | Schema:
accounts (alias: acct)(value, name, date, code)
departments(status, type, salary, amount)
Task: Find id from accounts where a matching record exists in departments with the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13503 | train |
v3 | Schema:
orders (alias: ord)(status, name, value, amount)
shipments(name, code, level, amount)
Task: Find value from orders where amount exceeds the average value from shipments for the same code.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13504 | train |
v3 | Schema:
categories (alias: catg)(status, type, level, date)
customers(id, value, code, amount)
Task: Retrieve id from categories with amount above the COUNT(value) of customers rows sharing the same type.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13505 | train |
v2 | Schema:
accounts (alias: acct)(amount, type, salary, status)
invoices(name, level, amount, salary)
Task: Find amount from accounts where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13506 | train |
v2 | Schema:
products (alias: prod)(code, type, level, salary)
managers(status, level, date, value)
Task: Find code from products where a matching record exists in managers with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13507 | train |
v2 | Schema:
tasks (alias: tsk)(status, name, id, value)
schedules(status, amount, id, type)
Task: Find name from tasks where a matching record exists in schedules with the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13508 | train |
v2 | Schema:
customers (alias: cust)(status, name, salary, id)
staff(code, id, type, name)
Task: Retrieve name from customers that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13509 | train |
v2 | Schema:
projects (alias: prj)(status, name, amount, id)
customers(code, salary, name, level)
Task: Find id from projects where a matching record exists in customers with the same code.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13510 | train |
v3 | Schema:
employees (alias: emp)(amount, name, status, code)
managers(salary, date, value, level)
Task: Retrieve salary from employees with salary above the AVG(amount) of managers rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13511 | train |
v1 | Schema:
requests (alias: ordr)(date, name, type, code)
tasks(type, level, code, status)
Task: Retrieve code from requests whose id is found in tasks rows where status matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13512 | train |
v1 | Schema:
items (alias: lne)(level, status, id, amount)
transactions(status, id, value, name)
Task: Select amount from items where level exists in transactions for the same id.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13513 | train |
v1 | Schema:
shipments (alias: shp)(name, status, level, salary)
departments(type, name, level, id)
Task: Find salary from shipments where code appears in departments entries with matching code.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13514 | train |
v2 | Schema:
tasks (alias: tsk)(amount, value, level, salary)
departments(type, date, level, id)
Task: Find code from tasks where a matching record exists in departments with the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13515 | train |
v2 | Schema:
accounts (alias: acct)(salary, date, type, status)
sales(id, type, level, name)
Task: Find name from accounts where a matching record exists in sales with the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13516 | train |
v1 | Schema:
branches (alias: brc)(status, level, name, amount)
regions(name, id, level, salary)
Task: Select code from branches where id exists in regions for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13517 | train |
v2 | Schema:
branches (alias: brc)(amount, value, date, code)
categories(name, level, date, type)
Task: Find value from branches where a matching record exists in categories with the same status.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13518 | train |
v2 | Schema:
invoices (alias: inv)(level, code, date, type)
items(status, date, name, salary)
Task: Find value from invoices where a matching record exists in items with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13519 | train |
v3 | Schema:
schedules (alias: schd)(amount, name, level, id)
requests(value, code, type, name)
Task: Retrieve code from schedules with amount above the AVG(value) of requests rows sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13520 | train |
v3 | Schema:
invoices (alias: inv)(level, date, value, status)
projects(name, level, type, status)
Task: Retrieve code from invoices with value above the MIN(value) of projects rows sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13521 | train |
v2 | Schema:
schedules (alias: schd)(code, status, salary, value)
departments(status, level, salary, name)
Task: Find name from schedules where a matching record exists in departments with the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13522 | train |
v2 | Schema:
transactions (alias: txn)(type, salary, name, level)
orders(name, date, status, salary)
Task: Retrieve value from transactions that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13523 | train |
v1 | Schema:
customers (alias: cust)(name, code, id, type)
tasks(date, id, level, type)
Task: Select amount from customers where id exists in tasks for the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13524 | train |
v2 | Schema:
tasks (alias: tsk)(code, value, salary, status)
sales(date, salary, type, amount)
Task: Retrieve id from tasks that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13525 | train |
v1 | Schema:
orders (alias: ord)(code, name, level, salary)
staff(code, salary, status, date)
Task: Find amount from orders where type appears in staff entries with matching status.
SQL: | SELECT amount FROM orders AS ord
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13526 | train |
v2 | Schema:
managers (alias: mgr)(status, name, level, code)
branches(name, type, amount, level)
Task: Find id from managers where a matching record exists in branches with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13527 | train |
v3 | Schema:
managers (alias: mgr)(salary, value, id, type)
accounts(name, code, salary, date)
Task: Find name from managers where amount exceeds the total value from accounts for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13528 | train |
v2 | Schema:
projects (alias: prj)(status, amount, code, salary)
invoices(amount, value, id, code)
Task: Retrieve id from projects that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13529 | train |
v1 | Schema:
categories (alias: catg)(amount, id, salary, code)
employees(status, type, date, name)
Task: Retrieve id from categories whose type is found in employees rows where type matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13530 | train |
v3 | Schema:
shipments (alias: shp)(status, name, id, code)
requests(name, salary, level, code)
Task: Find id from shipments where amount exceeds the average amount from requests for the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13531 | train |
v2 | Schema:
regions (alias: rgn)(type, code, value, status)
tasks(salary, level, status, code)
Task: Find code from regions where a matching record exists in tasks with the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13532 | train |
v1 | Schema:
shipments (alias: shp)(status, type, name, amount)
managers(level, type, status, date)
Task: Find id from shipments where type appears in managers entries with matching level.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13533 | train |
v1 | Schema:
requests (alias: ordr)(date, salary, code, name)
items(code, date, type, value)
Task: Find id from requests where id appears in items entries with matching code.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13534 | train |
v2 | Schema:
regions (alias: rgn)(type, level, date, id)
schedules(value, level, status, code)
Task: Find id from regions where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13535 | train |
v2 | Schema:
accounts (alias: acct)(amount, status, level, name)
employees(name, code, date, amount)
Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13536 | train |
v3 | Schema:
schedules (alias: schd)(name, type, salary, date)
transactions(salary, type, id, date)
Task: Retrieve name from schedules with amount above the AVG(value) of transactions rows sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13537 | train |
v1 | Schema:
requests (alias: ordr)(code, name, salary, value)
departments(date, level, name, id)
Task: Find id from requests where type appears in departments entries with matching type.
SQL: | SELECT id FROM requests AS ordr
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13538 | train |
v3 | Schema:
regions (alias: rgn)(salary, amount, name, code)
tasks(status, value, level, amount)
Task: Find salary from regions where amount exceeds the maximum amount from tasks for the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13539 | train |
v1 | Schema:
managers (alias: mgr)(amount, id, level, code)
orders(code, value, amount, date)
Task: Retrieve name from managers whose id is found in orders rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13540 | train |
v3 | Schema:
staff (alias: empl)(code, level, amount, salary)
orders(salary, value, level, type)
Task: Retrieve value from staff with value above the AVG(salary) of orders rows sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13541 | train |
v3 | Schema:
sales (alias: sale)(level, date, id, name)
employees(amount, code, name, id)
Task: Retrieve code from sales with value above the COUNT(value) of employees rows sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13542 | train |
v3 | Schema:
shipments (alias: shp)(status, value, id, level)
employees(status, level, amount, type)
Task: Find id from shipments where salary exceeds the maximum amount from employees for the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13543 | train |
v1 | Schema:
customers (alias: cust)(status, date, value, amount)
orders(name, code, salary, amount)
Task: Find code from customers where level appears in orders entries with matching code.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13544 | train |
v2 | Schema:
products (alias: prod)(status, name, salary, date)
staff(id, value, status, code)
Task: Find amount from products where a matching record exists in staff with the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13545 | train |
v1 | Schema:
accounts (alias: acct)(type, level, salary, id)
branches(name, value, date, type)
Task: Find value from accounts where level appears in branches entries with matching level.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13546 | train |
v1 | Schema:
managers (alias: mgr)(code, salary, level, amount)
tasks(level, value, amount, salary)
Task: Retrieve value from managers whose level is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13547 | train |
v3 | Schema:
schedules (alias: schd)(date, status, id, amount)
projects(date, salary, type, value)
Task: Find value from schedules where amount exceeds the total amount from projects for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13548 | train |
v1 | Schema:
invoices (alias: inv)(level, status, salary, type)
projects(salary, level, amount, type)
Task: Find name from invoices where status appears in projects entries with matching status.
SQL: | SELECT name FROM invoices AS inv
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13549 | train |
v3 | Schema:
products (alias: prod)(salary, code, amount, value)
managers(date, salary, level, id)
Task: Find salary from products where amount exceeds the count of salary from managers for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13550 | train |
v1 | Schema:
projects (alias: prj)(name, date, amount, id)
transactions(code, id, name, level)
Task: Retrieve amount from projects whose code is found in transactions rows where type matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13551 | train |
v3 | Schema:
regions (alias: rgn)(salary, amount, type, level)
accounts(amount, status, name, level)
Task: Find code from regions where salary exceeds the total value from accounts for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13552 | train |
v2 | Schema:
branches (alias: brc)(level, salary, amount, code)
shipments(salary, code, value, name)
Task: Find salary from branches where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13553 | train |
v3 | Schema:
schedules (alias: schd)(code, name, date, level)
accounts(amount, type, code, id)
Task: Retrieve salary from schedules with salary above the SUM(value) of accounts rows sharing the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13554 | train |
v2 | Schema:
invoices (alias: inv)(type, status, value, level)
shipments(name, salary, amount, code)
Task: Find amount from invoices where a matching record exists in shipments with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13555 | train |
v3 | Schema:
orders (alias: ord)(date, value, amount, type)
accounts(type, amount, name, salary)
Task: Retrieve value from orders with salary above the MIN(salary) of accounts rows sharing the same code.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13556 | train |
v1 | Schema:
staff (alias: empl)(name, code, salary, type)
categories(salary, date, name, id)
Task: Find code from staff where status appears in categories entries with matching code.
SQL: | SELECT code FROM staff AS empl
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13557 | train |
v3 | Schema:
shipments (alias: shp)(id, name, date, amount)
items(date, code, value, salary)
Task: Find amount from shipments where value exceeds the minimum amount from items for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13558 | train |
v3 | Schema:
requests (alias: ordr)(type, name, date, salary)
transactions(salary, status, name, level)
Task: Retrieve id from requests with value above the AVG(salary) of transactions rows sharing the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13559 | train |
v1 | Schema:
employees (alias: emp)(date, name, type, status)
projects(amount, salary, id, date)
Task: Find salary from employees where level appears in projects entries with matching id.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13560 | train |
v1 | Schema:
sales (alias: sale)(code, salary, type, date)
regions(code, date, type, id)
Task: Find amount from sales where level appears in regions entries with matching status.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13561 | train |
v3 | Schema:
staff (alias: empl)(id, type, name, date)
orders(salary, level, status, date)
Task: Retrieve id from staff with value above the SUM(value) of orders rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13562 | train |
v1 | Schema:
projects (alias: prj)(date, name, value, amount)
employees(value, level, code, name)
Task: Retrieve value from projects whose code is found in employees rows where code matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13563 | train |
v1 | Schema:
departments (alias: dept)(amount, date, status, name)
categories(salary, level, date, name)
Task: Retrieve id from departments whose level is found in categories rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13564 | train |
v2 | Schema:
products (alias: prod)(id, type, status, level)
requests(date, value, name, salary)
Task: Find salary from products where a matching record exists in requests with the same level.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13565 | train |
v2 | Schema:
items (alias: lne)(id, type, name, amount)
staff(amount, type, status, name)
Task: Retrieve name from items that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13566 | train |
v3 | Schema:
managers (alias: mgr)(salary, amount, level, id)
staff(amount, salary, level, status)
Task: Retrieve id from managers with salary above the SUM(value) of staff rows sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13567 | train |
v3 | Schema:
branches (alias: brc)(date, level, id, name)
staff(code, status, salary, type)
Task: Find name from branches where salary exceeds the maximum amount from staff for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13568 | train |
v2 | Schema:
branches (alias: brc)(type, name, salary, amount)
tasks(salary, type, code, name)
Task: Find value from branches where a matching record exists in tasks with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13569 | train |
v3 | Schema:
managers (alias: mgr)(salary, amount, date, name)
employees(salary, name, id, level)
Task: Retrieve name from managers with amount above the MAX(salary) of employees rows sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13570 | train |
v2 | Schema:
items (alias: lne)(level, type, value, date)
customers(name, level, salary, type)
Task: Find value from items where a matching record exists in customers with the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13571 | train |
v1 | Schema:
staff (alias: empl)(date, name, level, salary)
shipments(status, value, name, id)
Task: Retrieve name from staff whose code is found in shipments rows where level matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13572 | train |
v2 | Schema:
customers (alias: cust)(value, salary, amount, code)
schedules(level, date, salary, id)
Task: Find amount from customers where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13573 | train |
v1 | Schema:
categories (alias: catg)(amount, code, salary, id)
invoices(value, name, level, date)
Task: Find code from categories where id appears in invoices entries with matching status.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13574 | train |
v2 | Schema:
orders (alias: ord)(id, level, type, salary)
invoices(amount, level, name, salary)
Task: Retrieve name from orders that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13575 | train |
v3 | Schema:
invoices (alias: inv)(id, amount, code, name)
departments(amount, code, id, value)
Task: Retrieve value from invoices with amount above the MAX(value) of departments rows sharing the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13576 | train |
v2 | Schema:
categories (alias: catg)(type, code, name, value)
accounts(type, id, code, level)
Task: Retrieve code from categories that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13577 | train |
v1 | Schema:
shipments (alias: shp)(type, code, amount, status)
accounts(level, status, code, value)
Task: Retrieve value from shipments whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13578 | train |
v1 | Schema:
tasks (alias: tsk)(status, name, value, code)
transactions(name, code, date, id)
Task: Retrieve id from tasks whose code is found in transactions rows where type matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13579 | train |
v3 | Schema:
departments (alias: dept)(name, date, level, code)
schedules(level, date, code, name)
Task: Retrieve amount from departments with amount above the SUM(amount) of schedules rows sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13580 | train |
v2 | Schema:
branches (alias: brc)(date, name, level, salary)
items(code, amount, name, type)
Task: Retrieve amount from branches that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13581 | train |
v3 | Schema:
departments (alias: dept)(type, value, name, level)
branches(id, salary, amount, name)
Task: Find id from departments where value exceeds the minimum value from branches for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13582 | train |
v2 | Schema:
categories (alias: catg)(value, name, id, type)
products(code, status, salary, level)
Task: Retrieve id from categories that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13583 | train |
v3 | Schema:
products (alias: prod)(salary, code, value, level)
tasks(value, salary, amount, id)
Task: Retrieve name from products with amount above the AVG(value) of tasks rows sharing the same code.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13584 | train |
v3 | Schema:
regions (alias: rgn)(type, salary, id, date)
sales(value, status, date, salary)
Task: Find code from regions where value exceeds the average salary from sales for the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13585 | train |
v1 | Schema:
orders (alias: ord)(status, date, amount, salary)
requests(level, code, salary, status)
Task: Select id from orders where id exists in requests for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13586 | train |
v1 | Schema:
items (alias: lne)(date, id, name, amount)
sales(id, status, date, level)
Task: Find code from items where type appears in sales entries with matching id.
SQL: | SELECT code FROM items AS lne
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = lne.id
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13587 | train |
v1 | Schema:
accounts (alias: acct)(name, id, status, value)
departments(id, salary, status, type)
Task: Find salary from accounts where code appears in departments entries with matching code.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13588 | train |
v2 | Schema:
sales (alias: sale)(salary, value, level, amount)
schedules(amount, type, status, name)
Task: Find amount from sales where a matching record exists in schedules with the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13589 | train |
v2 | Schema:
customers (alias: cust)(id, value, status, name)
requests(type, amount, date, value)
Task: Find amount from customers where a matching record exists in requests with the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13590 | train |
v2 | Schema:
departments (alias: dept)(amount, value, code, type)
categories(name, type, amount, salary)
Task: Retrieve amount from departments that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13591 | train |
v3 | Schema:
branches (alias: brc)(amount, type, level, id)
departments(amount, level, name, salary)
Task: Retrieve code from branches with amount above the MAX(value) of departments rows sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13592 | train |
v1 | Schema:
orders (alias: ord)(value, name, amount, level)
schedules(date, status, id, level)
Task: Select name from orders where level exists in schedules for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13593 | train |
v1 | Schema:
projects (alias: prj)(status, code, amount, level)
products(status, amount, level, value)
Task: Retrieve name from projects whose type is found in products rows where level matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13594 | train |
v2 | Schema:
items (alias: lne)(salary, date, amount, level)
managers(type, id, name, salary)
Task: Find code from items where a matching record exists in managers with the same status.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13595 | train |
v3 | Schema:
items (alias: lne)(name, date, value, status)
staff(date, salary, id, value)
Task: Find salary from items where salary exceeds the average amount from staff for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13596 | train |
v1 | Schema:
sales (alias: sale)(amount, level, date, id)
products(date, type, code, amount)
Task: Retrieve amount from sales whose level is found in products rows where type matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13597 | train |
v2 | Schema:
orders (alias: ord)(salary, id, value, level)
tasks(status, id, code, value)
Task: Find value from orders where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13598 | train |
v3 | Schema:
staff (alias: empl)(code, salary, id, value)
employees(name, salary, code, id)
Task: Retrieve amount from staff with amount above the SUM(value) of employees rows sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.