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: shipments (alias: shp)(code, date, value, level) transactions(salary, name, status, code) Task: Retrieve salary from shipments with amount above the AVG(salary) of transactions rows sharing the same id. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10100
train
v2
Schema: invoices (alias: inv)(status, type, amount, date) projects(value, id, name, code) Task: Find id from invoices where a matching record exists in projects with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10101
train
v1
Schema: invoices (alias: inv)(id, value, type, amount) regions(code, id, salary, type) Task: Select code from invoices where code exists in regions for the same level. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10102
train
v1
Schema: items (alias: lne)(code, name, date, id) staff(salary, value, status, type) Task: Select salary from items where level exists in staff for the same type. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10103
train
v2
Schema: shipments (alias: shp)(type, id, amount, status) orders(amount, id, level, salary) Task: Retrieve amount from shipments that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10104
train
v2
Schema: shipments (alias: shp)(salary, id, name, amount) departments(code, id, name, status) Task: Retrieve amount from shipments that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10105
train
v2
Schema: customers (alias: cust)(id, status, value, code) items(level, date, name, id) Task: Retrieve value from customers that have at least one corresponding entry in items sharing the same code. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = cust.code );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10106
train
v2
Schema: managers (alias: mgr)(salary, level, name, date) departments(name, id, salary, amount) Task: Retrieve id from managers that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = mgr.id );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10107
train
v1
Schema: branches (alias: brc)(value, date, name, status) orders(value, name, level, code) Task: Select salary from branches where level exists in orders for the same id. SQL:
SELECT salary FROM branches AS brc WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.id = brc.id );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10108
train
v2
Schema: products (alias: prod)(code, salary, name, value) projects(status, salary, type, date) Task: Retrieve salary from products that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = prod.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10109
train
v1
Schema: transactions (alias: txn)(level, value, amount, code) employees(id, amount, code, status) Task: Find salary from transactions where id appears in employees entries with matching level. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10110
train
v1
Schema: accounts (alias: acct)(date, type, code, salary) invoices(status, name, id, salary) Task: Select code from accounts where id exists in invoices for the same level. SQL:
SELECT code FROM accounts AS acct WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10111
train
v3
Schema: categories (alias: catg)(date, id, code, value) transactions(value, amount, type, code) Task: Find name from categories where salary exceeds the count of value from transactions for the same id. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10112
train
v2
Schema: projects (alias: prj)(id, code, salary, level) invoices(type, value, id, amount) Task: Retrieve id from projects that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10113
train
v1
Schema: requests (alias: ordr)(value, level, date, amount) managers(value, amount, level, code) Task: Retrieve name from requests whose status is found in managers rows where code matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10114
train
v2
Schema: staff (alias: empl)(amount, type, id, status) shipments(level, value, amount, status) Task: Retrieve name from staff that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10115
train
v1
Schema: schedules (alias: schd)(salary, name, code, level) departments(code, amount, value, salary) Task: Find code from schedules where level appears in departments entries with matching status. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10116
train
v1
Schema: schedules (alias: schd)(name, level, date, id) orders(level, date, code, salary) Task: Select value from schedules where status exists in orders for the same level. SQL:
SELECT value FROM schedules AS schd WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10117
train
v1
Schema: schedules (alias: schd)(status, value, id, type) branches(code, value, name, date) Task: Select code from schedules where id exists in branches for the same level. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10118
train
v1
Schema: schedules (alias: schd)(id, salary, level, code) orders(amount, id, value, salary) Task: Find salary from schedules where status appears in orders entries with matching status. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = schd.status );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10119
train
v1
Schema: schedules (alias: schd)(code, date, amount, level) employees(status, name, code, type) Task: Find code from schedules where level appears in employees entries with matching status. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10120
train
v3
Schema: orders (alias: ord)(name, code, type, salary) schedules(id, salary, amount, code) Task: Retrieve id from orders with amount above the AVG(amount) of schedules rows sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10121
train
v1
Schema: branches (alias: brc)(level, name, amount, salary) projects(level, value, status, type) Task: Select amount from branches where status exists in projects for the same level. SQL:
SELECT amount FROM branches AS brc WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = brc.level );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10122
train
v1
Schema: schedules (alias: schd)(value, type, amount, name) customers(status, type, code, value) Task: Find salary from schedules where code appears in customers entries with matching type. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10123
train
v3
Schema: shipments (alias: shp)(date, name, value, salary) customers(code, level, salary, value) Task: Find code from shipments where amount exceeds the count of value from customers for the same code. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10124
train
v2
Schema: items (alias: lne)(id, name, type, code) accounts(date, name, level, status) Task: Find value from items where a matching record exists in accounts with the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = lne.status );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10125
train
v1
Schema: departments (alias: dept)(level, amount, date, value) branches(date, salary, type, status) Task: Select id from departments where status exists in branches for the same status. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.status = dept.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10126
train
v1
Schema: managers (alias: mgr)(value, code, name, date) staff(status, date, id, code) Task: Retrieve id from managers whose status is found in staff rows where code matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10127
train
v3
Schema: orders (alias: ord)(id, status, value, amount) staff(level, type, code, id) Task: Retrieve salary from orders with value above the COUNT(amount) of staff rows sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.id = ord.id );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10128
train
v3
Schema: managers (alias: mgr)(date, code, name, salary) shipments(code, value, salary, id) Task: Retrieve code from managers with salary above the MIN(value) of shipments rows sharing the same status. SQL:
SELECT code FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10129
train
v1
Schema: tasks (alias: tsk)(type, value, salary, amount) categories(salary, type, id, code) Task: Retrieve code from tasks whose status is found in categories rows where code matches the outer record. SQL:
SELECT code FROM tasks AS tsk WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10130
train
v2
Schema: managers (alias: mgr)(status, salary, type, level) sales(value, status, level, salary) Task: Retrieve name from managers that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = mgr.type );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10131
train
v1
Schema: requests (alias: ordr)(name, date, salary, level) managers(salary, level, id, amount) Task: Find amount from requests where id appears in managers entries with matching id. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10132
train
v1
Schema: branches (alias: brc)(name, code, amount, value) tasks(amount, code, name, id) Task: Retrieve name from branches whose type is found in tasks rows where code matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10133
train
v2
Schema: customers (alias: cust)(value, id, name, code) regions(value, date, id, salary) Task: Find value from customers where a matching record exists in regions with the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10134
train
v3
Schema: staff (alias: empl)(date, status, amount, name) projects(status, amount, date, code) Task: Find amount from staff where salary exceeds the maximum salary from projects for the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.level = empl.level );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10135
train
v3
Schema: orders (alias: ord)(level, code, id, amount) departments(code, salary, date, name) Task: Find code from orders where amount exceeds the maximum amount from departments for the same id. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10136
train
v2
Schema: orders (alias: ord)(name, amount, level, id) shipments(salary, id, amount, date) Task: Find salary from orders where a matching record exists in shipments with the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = ord.code );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10137
train
v1
Schema: managers (alias: mgr)(salary, amount, id, status) tasks(date, id, level, amount) Task: Select name from managers where type exists in tasks for the same code. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10138
train
v2
Schema: managers (alias: mgr)(amount, salary, date, code) sales(status, salary, date, name) Task: Find id from managers where a matching record exists in sales with the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10139
train
v1
Schema: projects (alias: prj)(code, amount, id, salary) sales(type, level, status, name) Task: Select value from projects where code exists in sales for the same status. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.status = prj.status );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10140
train
v1
Schema: transactions (alias: txn)(value, date, level, status) categories(type, id, name, status) Task: Retrieve code from transactions whose id is found in categories rows where status matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10141
train
v2
Schema: accounts (alias: acct)(amount, level, value, date) requests(amount, type, salary, level) Task: Retrieve amount from accounts that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10142
train
v3
Schema: regions (alias: rgn)(type, id, name, code) requests(name, amount, type, id) Task: Find id from regions where value exceeds the count of value from requests for the same status. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10143
train
v2
Schema: departments (alias: dept)(type, status, level, value) regions(id, value, status, date) Task: Find code from departments where a matching record exists in regions with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10144
train
v2
Schema: items (alias: lne)(level, id, amount, status) departments(id, status, salary, type) Task: Retrieve value from items that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = lne.code );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10145
train
v1
Schema: employees (alias: emp)(value, status, code, name) invoices(amount, name, type, id) Task: Find id from employees where code appears in invoices entries with matching level. SQL:
SELECT id FROM employees AS emp WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10146
train
v1
Schema: transactions (alias: txn)(code, id, date, status) customers(status, name, type, level) Task: Find value from transactions where type appears in customers entries with matching status. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = txn.status );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10147
train
v2
Schema: schedules (alias: schd)(date, type, id, value) categories(status, amount, level, type) Task: Find amount from schedules where a matching record exists in categories with the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10148
train
v1
Schema: requests (alias: ordr)(code, type, level, name) orders(amount, type, code, id) Task: Select amount from requests where id exists in orders for the same type. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = ordr.type );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10149
train
v1
Schema: customers (alias: cust)(type, salary, value, name) branches(status, salary, code, name) Task: Retrieve id from customers whose code is found in branches rows where level matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.level = cust.level );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10150
train
v2
Schema: invoices (alias: inv)(level, salary, value, status) staff(date, level, status, code) Task: Find name from invoices where a matching record exists in staff with the same status. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10151
train
v2
Schema: transactions (alias: txn)(salary, status, date, name) categories(value, code, level, status) Task: Find value from transactions where a matching record exists in categories with the same status. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10152
train
v2
Schema: requests (alias: ordr)(type, status, salary, value) projects(status, id, code, amount) Task: Find salary from requests where a matching record exists in projects with the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = ordr.type );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10153
train
v1
Schema: branches (alias: brc)(level, status, value, type) products(type, name, date, value) Task: Retrieve code from branches whose level is found in products rows where status matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = brc.status );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10154
train
v1
Schema: departments (alias: dept)(level, salary, status, value) categories(salary, date, type, status) Task: Find value from departments where status appears in categories entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = dept.code );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10155
train
v2
Schema: tasks (alias: tsk)(amount, type, level, name) categories(name, code, level, salary) Task: Find code from tasks where a matching record exists in categories with the same code. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10156
train
v3
Schema: customers (alias: cust)(code, type, value, amount) sales(code, amount, name, id) Task: Retrieve id from customers with value above the MAX(salary) of sales rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.id = cust.id );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10157
train
v3
Schema: employees (alias: emp)(salary, code, value, status) transactions(amount, id, value, code) Task: Find id from employees where amount exceeds the maximum value from transactions for the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10158
train
v1
Schema: branches (alias: brc)(date, id, name, type) sales(code, status, salary, level) Task: Find amount from branches where level appears in sales entries with matching level. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.level = brc.level );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10159
train
v2
Schema: orders (alias: ord)(amount, name, status, date) shipments(id, name, code, amount) Task: Retrieve name from orders that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10160
train
v2
Schema: managers (alias: mgr)(type, code, id, name) requests(id, code, amount, type) Task: Find id from managers where a matching record exists in requests with the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = mgr.status );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10161
train
v3
Schema: departments (alias: dept)(date, amount, salary, code) categories(name, status, date, level) Task: Retrieve salary from departments with amount above the COUNT(amount) of categories rows sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10162
train
v2
Schema: invoices (alias: inv)(name, status, level, date) accounts(level, status, salary, name) Task: Retrieve amount from invoices that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10163
train
v3
Schema: managers (alias: mgr)(date, value, status, type) transactions(status, amount, type, salary) Task: Retrieve salary from managers with salary above the MIN(value) of transactions rows sharing the same type. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10164
train
v3
Schema: branches (alias: brc)(name, type, level, salary) transactions(value, type, date, name) Task: Find code from branches where amount exceeds the average salary from transactions for the same id. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.id = brc.id );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10165
train
v3
Schema: schedules (alias: schd)(amount, type, level, value) requests(id, salary, amount, date) Task: Find id from schedules where salary exceeds the average value from requests for the same code. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( 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": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10166
train
v3
Schema: shipments (alias: shp)(type, value, name, id) transactions(date, code, status, name) Task: Retrieve value from shipments with amount above the MAX(salary) of transactions rows sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10167
train
v2
Schema: employees (alias: emp)(salary, id, name, code) branches(type, id, salary, value) Task: Retrieve code from employees that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10168
train
v3
Schema: managers (alias: mgr)(code, value, type, name) staff(type, id, name, value) Task: Find name from managers where value exceeds the average value from staff for the same type. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10169
train
v2
Schema: branches (alias: brc)(code, type, date, amount) products(code, date, name, salary) Task: Find name from branches where a matching record exists in products with the same level. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = brc.level );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10170
train
v2
Schema: customers (alias: cust)(date, value, status, name) orders(type, code, salary, status) Task: Retrieve amount from customers that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = cust.id );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10171
train
v3
Schema: customers (alias: cust)(id, name, salary, amount) managers(name, status, type, salary) Task: Retrieve code from customers with amount above the SUM(salary) of managers rows sharing the same code. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.code = cust.code );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10172
train
v1
Schema: managers (alias: mgr)(id, level, code, name) staff(type, salary, name, amount) Task: Retrieve id from managers whose type is found in staff rows where code matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10173
train
v1
Schema: customers (alias: cust)(date, code, type, name) regions(level, type, code, salary) Task: Select id from customers where level exists in regions for the same level. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10174
train
v1
Schema: shipments (alias: shp)(salary, code, name, date) orders(value, level, id, type) Task: Select amount from shipments where status exists in orders for the same type. SQL:
SELECT amount FROM shipments AS shp WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10175
train
v1
Schema: regions (alias: rgn)(level, salary, code, amount) products(status, value, name, type) Task: Find salary from regions where id appears in products entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10176
train
v1
Schema: shipments (alias: shp)(id, status, value, code) items(id, value, level, amount) Task: Find id from shipments where level appears in items entries with matching code. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10177
train
v1
Schema: schedules (alias: schd)(date, name, type, value) products(salary, value, amount, type) Task: Select salary from schedules where type exists in products for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10178
train
v2
Schema: products (alias: prod)(status, date, level, id) shipments(name, level, date, type) Task: Retrieve name from products that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10179
train
v1
Schema: tasks (alias: tsk)(date, name, status, id) staff(type, value, name, date) Task: Retrieve salary from tasks whose status is found in staff rows where id matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10180
train
v3
Schema: categories (alias: catg)(salary, id, code, amount) shipments(date, level, value, amount) Task: Retrieve name from categories with salary above the COUNT(value) of shipments rows sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10181
train
v2
Schema: orders (alias: ord)(id, name, salary, value) categories(amount, name, status, value) Task: Retrieve amount from orders that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10182
train
v3
Schema: requests (alias: ordr)(type, level, amount, id) transactions(value, name, amount, type) Task: Find amount from requests where value exceeds the count of amount from transactions for the same level. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10183
train
v2
Schema: schedules (alias: schd)(salary, amount, value, status) orders(code, value, type, amount) Task: Retrieve amount from schedules that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10184
train
v3
Schema: departments (alias: dept)(status, type, value, level) invoices(type, salary, amount, name) Task: Retrieve code from departments with amount above the AVG(amount) of invoices rows sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.code = dept.code );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10185
train
v3
Schema: categories (alias: catg)(salary, status, amount, id) customers(date, status, salary, name) Task: Retrieve code from categories with value above the MIN(salary) of customers rows sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE value > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10186
train
v1
Schema: departments (alias: dept)(amount, value, status, code) projects(status, id, value, level) Task: Retrieve value from departments whose id is found in projects rows where level matches the outer record. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.level = dept.level );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10187
train
v3
Schema: staff (alias: empl)(salary, code, value, name) departments(code, amount, value, level) Task: Find name from staff where salary exceeds the count of amount from departments for the same code. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.code = empl.code );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10188
train
v1
Schema: items (alias: lne)(value, name, code, date) requests(amount, id, status, name) Task: Select value from items where status exists in requests for the same status. SQL:
SELECT value FROM items AS lne WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10189
train
v2
Schema: projects (alias: prj)(level, amount, value, code) schedules(salary, type, code, id) Task: Find salary from projects where a matching record exists in schedules with the same code. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = prj.code );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10190
train
v1
Schema: orders (alias: ord)(amount, salary, name, value) employees(type, level, value, salary) Task: Select salary from orders where status exists in employees for the same id. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10191
train
v3
Schema: transactions (alias: txn)(date, level, value, name) schedules(amount, name, salary, code) Task: Find amount from transactions where amount exceeds the maximum amount from schedules for the same id. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.id = txn.id );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10192
train
v1
Schema: schedules (alias: schd)(code, amount, date, salary) tasks(code, id, name, value) Task: Select name from schedules where code exists in tasks for the same id. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = schd.id );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10193
train
v1
Schema: branches (alias: brc)(status, name, type, value) employees(type, amount, value, salary) Task: Select id from branches where type exists in employees for the same level. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = brc.level );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10194
train
v3
Schema: sales (alias: sale)(id, salary, value, name) items(value, date, id, salary) Task: Find code from sales where value exceeds the maximum salary from items for the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10195
train
v2
Schema: products (alias: prod)(salary, id, amount, value) accounts(level, code, amount, name) Task: Find amount from products where a matching record exists in accounts with the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10196
train
v1
Schema: products (alias: prod)(code, salary, status, type) employees(name, amount, type, id) Task: Find id from products where level appears in employees entries with matching type. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10197
train
v3
Schema: tasks (alias: tsk)(code, id, value, date) managers(status, code, id, level) Task: Retrieve name from tasks with value above the COUNT(amount) of managers rows sharing the same code. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10198
train
v1
Schema: projects (alias: prj)(id, date, level, type) items(amount, name, id, status) Task: Select amount from projects where type exists in items for the same id. SQL:
SELECT amount FROM projects AS prj WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10199
train