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 |
|---|---|---|---|---|---|---|
v1 | Schema:
regions (alias: rgn)(amount, salary, id, type)
items(salary, amount, status, date)
Task: Find name from regions where status appears in items entries with matching code.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14500 | train |
v2 | Schema:
branches (alias: brc)(date, status, salary, amount)
products(type, code, salary, amount)
Task: Find code from branches where a matching record exists in products with the same status.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14501 | train |
v3 | Schema:
sales (alias: sale)(level, type, name, code)
customers(level, status, name, value)
Task: Retrieve amount from sales with value above the SUM(value) of customers rows sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14502 | train |
v3 | Schema:
sales (alias: sale)(type, id, date, salary)
transactions(salary, type, status, code)
Task: Retrieve id from sales with amount above the AVG(amount) of transactions rows sharing the same status.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14503 | train |
v1 | Schema:
accounts (alias: acct)(status, amount, code, id)
schedules(level, value, salary, code)
Task: Retrieve salary from accounts whose code is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14504 | train |
v2 | Schema:
sales (alias: sale)(type, id, date, value)
transactions(level, type, id, date)
Task: Retrieve code from sales that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14505 | train |
v1 | Schema:
shipments (alias: shp)(value, code, name, amount)
branches(amount, id, level, status)
Task: Retrieve id from shipments whose id is found in branches rows where level matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14506 | train |
v1 | Schema:
shipments (alias: shp)(code, salary, id, level)
products(amount, value, salary, date)
Task: Retrieve amount from shipments whose level is found in products rows where id matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14507 | train |
v3 | Schema:
invoices (alias: inv)(type, name, date, code)
projects(date, type, code, status)
Task: Retrieve code from invoices with amount above the AVG(value) of projects rows sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT AVG(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": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14508 | train |
v1 | Schema:
regions (alias: rgn)(level, code, amount, type)
accounts(date, name, salary, level)
Task: Find id from regions where status appears in accounts entries with matching code.
SQL: | SELECT id FROM regions AS rgn
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14509 | train |
v2 | Schema:
products (alias: prod)(id, status, type, salary)
managers(code, name, salary, id)
Task: Find id from products where a matching record exists in managers with the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14510 | train |
v3 | Schema:
tasks (alias: tsk)(type, amount, value, date)
schedules(salary, name, code, status)
Task: Find amount from tasks where salary exceeds the average amount from schedules for the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14511 | train |
v3 | Schema:
branches (alias: brc)(status, type, level, value)
categories(date, amount, code, name)
Task: Retrieve code from branches with value above the COUNT(amount) of categories rows sharing the same status.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14512 | train |
v1 | Schema:
sales (alias: sale)(id, salary, level, value)
departments(salary, id, code, value)
Task: Retrieve code from sales whose code is found in departments rows where code matches the outer record.
SQL: | SELECT code FROM sales AS sale
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14513 | train |
v2 | Schema:
accounts (alias: acct)(amount, date, type, value)
customers(salary, type, amount, code)
Task: Find name from accounts where a matching record exists in customers with the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14514 | train |
v1 | Schema:
managers (alias: mgr)(id, amount, level, name)
sales(id, type, code, value)
Task: Retrieve code from managers whose code is found in sales rows where type matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14515 | train |
v3 | Schema:
categories (alias: catg)(code, salary, status, type)
items(level, code, amount, type)
Task: Retrieve id from categories with amount above the COUNT(amount) of items rows sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14516 | train |
v1 | Schema:
regions (alias: rgn)(level, date, name, salary)
orders(level, value, status, type)
Task: Retrieve name from regions whose type is found in orders rows where id matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14517 | train |
v1 | Schema:
transactions (alias: txn)(status, date, type, salary)
projects(type, level, code, name)
Task: Retrieve name from transactions whose id is found in projects rows where id matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14518 | train |
v2 | Schema:
branches (alias: brc)(status, name, code, amount)
categories(level, name, status, salary)
Task: Retrieve id from branches that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14519 | train |
v1 | Schema:
schedules (alias: schd)(code, name, salary, type)
sales(name, salary, amount, date)
Task: Retrieve salary from schedules whose level is found in sales rows where status matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14520 | train |
v3 | Schema:
branches (alias: brc)(value, code, status, amount)
tasks(type, name, amount, id)
Task: Retrieve code from branches with amount above the MAX(amount) of tasks rows sharing the same id.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14521 | train |
v2 | Schema:
staff (alias: empl)(type, date, value, amount)
schedules(id, status, code, type)
Task: Retrieve code from staff that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14522 | train |
v1 | Schema:
regions (alias: rgn)(code, status, salary, level)
schedules(status, value, code, name)
Task: Find salary from regions where type appears in schedules entries with matching id.
SQL: | SELECT salary FROM regions AS rgn
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14523 | train |
v2 | Schema:
tasks (alias: tsk)(id, salary, code, date)
products(type, level, salary, name)
Task: Retrieve id from tasks that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14524 | train |
v1 | Schema:
requests (alias: ordr)(amount, date, name, id)
projects(code, name, type, value)
Task: Retrieve name from requests whose code is found in projects rows where id matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14525 | train |
v2 | Schema:
managers (alias: mgr)(code, id, type, level)
employees(type, code, amount, salary)
Task: Find code from managers where a matching record exists in employees with the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14526 | train |
v3 | Schema:
managers (alias: mgr)(salary, code, amount, value)
categories(type, level, date, id)
Task: Find code from managers where amount exceeds the count of salary from categories for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14527 | train |
v3 | Schema:
tasks (alias: tsk)(salary, name, level, status)
schedules(amount, level, salary, code)
Task: Retrieve name from tasks with amount above the AVG(amount) of schedules rows sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14528 | train |
v2 | Schema:
sales (alias: sale)(name, value, salary, date)
departments(date, type, status, amount)
Task: Retrieve id from sales that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14529 | train |
v2 | Schema:
regions (alias: rgn)(code, value, id, status)
schedules(status, salary, code, name)
Task: Find amount from regions where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14530 | train |
v1 | Schema:
regions (alias: rgn)(code, value, date, salary)
sales(amount, type, name, code)
Task: Find value from regions where type appears in sales entries with matching type.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14531 | train |
v2 | Schema:
products (alias: prod)(value, name, code, type)
departments(id, date, status, level)
Task: Retrieve name from products that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14532 | train |
v2 | Schema:
requests (alias: ordr)(type, value, name, status)
branches(type, code, status, name)
Task: Find value from requests where a matching record exists in branches with the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14533 | train |
v2 | Schema:
sales (alias: sale)(amount, salary, id, type)
employees(type, level, status, amount)
Task: Retrieve id from sales that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14534 | train |
v3 | Schema:
requests (alias: ordr)(name, type, date, id)
customers(date, name, type, code)
Task: Find code from requests where salary exceeds the minimum value from customers for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14535 | train |
v2 | Schema:
projects (alias: prj)(level, name, value, code)
requests(level, type, amount, salary)
Task: Retrieve value from projects that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14536 | train |
v1 | Schema:
products (alias: prod)(status, type, value, salary)
sales(id, amount, value, status)
Task: Retrieve amount from products whose code is found in sales rows where type matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = prod.type
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14537 | train |
v3 | Schema:
accounts (alias: acct)(status, code, type, level)
staff(id, salary, code, level)
Task: Find value from accounts where amount exceeds the maximum value from staff for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14538 | train |
v3 | Schema:
regions (alias: rgn)(salary, date, status, id)
departments(code, salary, date, value)
Task: Retrieve code from regions with value above the AVG(value) of departments rows sharing the same status.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14539 | train |
v3 | Schema:
requests (alias: ordr)(status, salary, type, id)
categories(amount, level, type, value)
Task: Retrieve code from requests with value above the MIN(value) of categories rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14540 | train |
v3 | Schema:
branches (alias: brc)(level, type, value, name)
staff(amount, date, id, name)
Task: Retrieve amount from branches with salary above the COUNT(value) of staff rows sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14541 | train |
v1 | Schema:
tasks (alias: tsk)(id, type, amount, salary)
managers(level, amount, status, type)
Task: Retrieve value from tasks whose status is found in managers rows where id matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14542 | train |
v1 | Schema:
departments (alias: dept)(date, type, salary, name)
orders(code, amount, status, id)
Task: Select salary from departments where id exists in orders for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14543 | train |
v2 | Schema:
transactions (alias: txn)(status, code, salary, value)
tasks(salary, id, date, level)
Task: Retrieve salary from transactions that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14544 | train |
v1 | Schema:
transactions (alias: txn)(level, name, code, status)
tasks(code, amount, status, id)
Task: Retrieve code from transactions whose level is found in tasks rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14545 | train |
v2 | Schema:
shipments (alias: shp)(value, salary, id, name)
items(salary, level, value, id)
Task: Retrieve code from shipments that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14546 | train |
v3 | Schema:
departments (alias: dept)(name, salary, date, status)
orders(name, date, value, level)
Task: Find code from departments where value exceeds the total amount from orders for the same type.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14547 | train |
v1 | Schema:
products (alias: prod)(name, status, type, value)
employees(value, type, salary, id)
Task: Find amount from products where status appears in employees entries with matching level.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14548 | train |
v3 | Schema:
products (alias: prod)(id, level, value, status)
items(salary, name, id, value)
Task: Retrieve salary from products with salary above the MAX(amount) of items rows sharing the same level.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14549 | train |
v3 | Schema:
customers (alias: cust)(status, code, amount, date)
products(id, type, salary, status)
Task: Retrieve code from customers with amount above the SUM(amount) of products rows sharing the same type.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14550 | train |
v3 | Schema:
orders (alias: ord)(type, date, salary, value)
categories(type, name, code, amount)
Task: Find id from orders where salary exceeds the minimum amount from categories for the same code.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14551 | train |
v3 | Schema:
requests (alias: ordr)(code, status, name, id)
departments(id, level, value, name)
Task: Retrieve code from requests with salary above the MAX(salary) of departments rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14552 | train |
v1 | Schema:
items (alias: lne)(amount, salary, name, code)
managers(status, id, name, date)
Task: Retrieve salary from items whose level is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14553 | train |
v3 | Schema:
branches (alias: brc)(value, date, level, id)
transactions(type, code, status, salary)
Task: Find salary from branches where amount exceeds the total salary from transactions for the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14554 | train |
v3 | Schema:
schedules (alias: schd)(level, salary, id, value)
departments(type, level, status, amount)
Task: Find amount from schedules where value exceeds the average salary from departments for the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14555 | train |
v1 | Schema:
departments (alias: dept)(code, level, salary, name)
accounts(amount, date, salary, name)
Task: Select id from departments where type exists in accounts for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14556 | train |
v2 | Schema:
customers (alias: cust)(salary, level, value, code)
requests(status, salary, code, id)
Task: Retrieve code from customers that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14557 | train |
v1 | Schema:
staff (alias: empl)(date, value, name, code)
items(type, name, amount, salary)
Task: Select salary from staff where level exists in items for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14558 | train |
v2 | Schema:
accounts (alias: acct)(salary, code, amount, level)
orders(status, name, type, salary)
Task: Find id from accounts where a matching record exists in orders with the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14559 | train |
v2 | Schema:
products (alias: prod)(level, value, code, date)
employees(id, name, salary, date)
Task: Find code from products where a matching record exists in employees with the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14560 | train |
v1 | Schema:
categories (alias: catg)(code, name, salary, level)
branches(name, amount, status, value)
Task: Find value from categories where id appears in branches entries with matching code.
SQL: | SELECT value FROM categories AS catg
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14561 | train |
v2 | Schema:
tasks (alias: tsk)(status, salary, amount, value)
departments(level, date, id, code)
Task: Retrieve amount from tasks that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14562 | train |
v2 | Schema:
categories (alias: catg)(status, amount, value, id)
products(value, level, name, status)
Task: Find salary from categories where a matching record exists in products with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14563 | train |
v1 | Schema:
branches (alias: brc)(value, level, type, amount)
tasks(id, type, name, amount)
Task: Select id from branches where type exists in tasks for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14564 | train |
v2 | Schema:
customers (alias: cust)(id, amount, salary, status)
transactions(amount, level, status, name)
Task: Find amount from customers where a matching record exists in transactions with the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14565 | train |
v1 | Schema:
categories (alias: catg)(salary, date, type, level)
transactions(date, value, salary, status)
Task: Select amount from categories where level exists in transactions for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14566 | train |
v1 | Schema:
transactions (alias: txn)(type, salary, value, code)
sales(amount, name, type, code)
Task: Find salary from transactions where type appears in sales entries with matching id.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14567 | train |
v2 | Schema:
shipments (alias: shp)(code, amount, id, status)
items(date, name, salary, type)
Task: Find name from shipments where a matching record exists in items with the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14568 | train |
v2 | Schema:
regions (alias: rgn)(date, name, level, value)
shipments(status, level, amount, value)
Task: Retrieve amount from regions that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14569 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, name, status)
employees(name, date, amount, status)
Task: Retrieve id from transactions with salary above the MIN(amount) of employees rows sharing the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14570 | train |
v3 | Schema:
sales (alias: sale)(id, date, level, name)
shipments(date, name, id, type)
Task: Find amount from sales where salary exceeds the maximum salary from shipments for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14571 | train |
v3 | Schema:
branches (alias: brc)(amount, id, code, type)
shipments(value, code, amount, salary)
Task: Find salary from branches where amount exceeds the count of value from shipments for the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE amount > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14572 | train |
v1 | Schema:
managers (alias: mgr)(name, type, level, date)
branches(date, code, value, type)
Task: Find id from managers where status appears in branches entries with matching type.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14573 | train |
v3 | Schema:
requests (alias: ordr)(date, status, level, value)
accounts(level, id, amount, name)
Task: Retrieve name from requests with amount above the COUNT(value) of accounts rows sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14574 | train |
v1 | Schema:
staff (alias: empl)(value, status, salary, amount)
branches(status, date, level, value)
Task: Retrieve salary from staff whose status is found in branches rows where type matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14575 | train |
v1 | Schema:
accounts (alias: acct)(level, id, code, value)
departments(level, amount, code, type)
Task: Retrieve name from accounts whose type is found in departments rows where code matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14576 | train |
v3 | Schema:
sales (alias: sale)(status, name, code, id)
orders(date, amount, id, value)
Task: Retrieve id from sales with amount above the MAX(value) of orders rows sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14577 | train |
v1 | Schema:
projects (alias: prj)(id, date, code, type)
products(amount, date, level, name)
Task: Retrieve amount from projects whose type is found in products rows where level matches the outer record.
SQL: | SELECT amount 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": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14578 | train |
v2 | Schema:
staff (alias: empl)(code, status, level, date)
products(code, type, level, value)
Task: Retrieve code from staff that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14579 | train |
v2 | Schema:
sales (alias: sale)(amount, id, level, status)
projects(salary, level, id, type)
Task: Find amount from sales where a matching record exists in projects with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14580 | train |
v3 | Schema:
employees (alias: emp)(salary, status, code, type)
customers(date, level, amount, status)
Task: Find value from employees where salary exceeds the minimum value from customers for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14581 | train |
v2 | Schema:
regions (alias: rgn)(code, salary, date, status)
products(level, date, status, value)
Task: Find value from regions where a matching record exists in products with the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14582 | train |
v1 | Schema:
sales (alias: sale)(level, amount, id, name)
transactions(id, amount, value, level)
Task: Select id from sales where status exists in transactions for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14583 | train |
v1 | Schema:
employees (alias: emp)(name, amount, value, type)
managers(id, salary, amount, status)
Task: Find id from employees where code appears in managers entries with matching id.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14584 | train |
v2 | Schema:
accounts (alias: acct)(name, type, status, date)
customers(value, status, date, name)
Task: Retrieve name from accounts that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14585 | train |
v1 | Schema:
transactions (alias: txn)(type, value, code, level)
sales(id, value, code, status)
Task: Retrieve salary from transactions whose status is found in sales rows where level matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14586 | train |
v2 | Schema:
accounts (alias: acct)(code, name, type, date)
employees(amount, type, value, code)
Task: Find code from accounts where a matching record exists in employees with the same level.
SQL: | SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14587 | train |
v1 | Schema:
tasks (alias: tsk)(name, code, value, amount)
staff(name, type, salary, code)
Task: Select amount from tasks where code exists in staff for the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14588 | train |
v1 | Schema:
branches (alias: brc)(name, id, code, level)
employees(date, type, level, status)
Task: Retrieve code from branches whose status is found in employees rows where status matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14589 | train |
v3 | Schema:
departments (alias: dept)(name, date, id, level)
shipments(code, salary, level, name)
Task: Retrieve name from departments with salary above the MIN(value) of shipments rows sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14590 | train |
v3 | Schema:
departments (alias: dept)(value, amount, status, date)
employees(name, amount, salary, level)
Task: Retrieve amount from departments with salary above the SUM(amount) of employees rows sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14591 | train |
v1 | Schema:
items (alias: lne)(date, level, id, amount)
staff(name, value, amount, salary)
Task: Retrieve amount from items whose status is found in staff rows where code matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14592 | train |
v1 | Schema:
transactions (alias: txn)(name, status, value, salary)
departments(code, level, date, type)
Task: Retrieve value from transactions whose type is found in departments rows where type matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14593 | train |
v1 | Schema:
tasks (alias: tsk)(id, level, status, type)
shipments(code, amount, name, type)
Task: Select amount from tasks where type exists in shipments for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14594 | train |
v2 | Schema:
branches (alias: brc)(amount, level, value, id)
invoices(date, id, status, name)
Task: Retrieve code from branches that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14595 | train |
v1 | Schema:
projects (alias: prj)(type, id, name, status)
products(status, amount, value, id)
Task: Select name from projects where type exists in products for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14596 | train |
v3 | Schema:
tasks (alias: tsk)(id, type, date, name)
sales(status, date, code, id)
Task: Find name from tasks where value exceeds the total salary from sales for the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14597 | train |
v3 | Schema:
employees (alias: emp)(type, code, salary, status)
branches(status, id, code, date)
Task: Retrieve value from employees with salary above the COUNT(salary) of branches rows sharing the same id.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14598 | train |
v1 | Schema:
requests (alias: ordr)(name, status, value, code)
branches(id, salary, status, type)
Task: Find amount from requests where id appears in branches entries with matching type.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14599 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.