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: projects (alias: prj)(value, salary, code, level) transactions(id, date, amount, type) Task: Retrieve name from projects with amount above the SUM(amount) of transactions rows sharing the same code. SQL:
SELECT name FROM projects AS prj WHERE amount > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.code = prj.code );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06100
train
v1
Schema: regions (alias: rgn)(type, amount, name, salary) employees(name, type, level, id) Task: Select name from regions where level exists in employees for the same level. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06101
train
v1
Schema: branches (alias: brc)(status, id, level, salary) employees(status, type, level, id) Task: Find value from branches where id appears in employees entries with matching id. SQL:
SELECT value FROM branches AS brc WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = brc.id );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06102
train
v3
Schema: departments (alias: dept)(salary, amount, value, name) customers(date, code, type, value) Task: Retrieve id from departments with value above the MIN(amount) of customers rows sharing the same level. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06103
train
v1
Schema: requests (alias: ordr)(type, date, id, amount) orders(name, salary, id, code) Task: Select amount from requests where code exists in orders for the same code. SQL:
SELECT amount FROM requests AS ordr WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06104
train
v2
Schema: projects (alias: prj)(amount, status, type, date) departments(id, name, amount, date) Task: Find salary from projects where a matching record exists in departments with the same level. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = prj.level );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "salary", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06105
train
v2
Schema: tasks (alias: tsk)(code, type, date, salary) managers(name, amount, salary, type) Task: Find code from tasks where a matching record exists in managers with the same id. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06106
train
v1
Schema: invoices (alias: inv)(id, name, status, amount) items(level, value, date, type) Task: Retrieve name from invoices whose code is found in items rows where id matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06107
train
v2
Schema: departments (alias: dept)(type, level, amount, value) items(code, id, date, name) Task: Find code from departments where a matching record exists in items with the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = dept.level );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06108
train
v3
Schema: requests (alias: ordr)(level, amount, name, salary) accounts(status, date, code, id) Task: Retrieve code from requests with amount above the MAX(amount) of accounts rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06109
train
v2
Schema: branches (alias: brc)(status, salary, name, date) items(id, code, name, level) Task: Retrieve code from branches that have at least one corresponding entry in items sharing the same status. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = brc.status );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06110
train
v1
Schema: employees (alias: emp)(code, id, amount, value) accounts(type, level, date, code) Task: Find salary from employees where type appears in accounts entries with matching status. SQL:
SELECT salary FROM employees AS emp WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = emp.status );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06111
train
v2
Schema: shipments (alias: shp)(type, value, name, level) requests(value, date, type, status) Task: Find amount from shipments where a matching record exists in requests with the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06112
train
v1
Schema: items (alias: lne)(amount, date, type, code) departments(salary, type, code, level) Task: Select code from items where code exists in departments for the same status. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06113
train
v2
Schema: items (alias: lne)(salary, amount, type, value) regions(value, id, name, code) Task: Find name from items where a matching record exists in regions with the same status. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06114
train
v2
Schema: sales (alias: sale)(level, amount, status, value) projects(level, id, value, type) Task: Find id from sales where a matching record exists in projects with the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06115
train
v2
Schema: products (alias: prod)(type, id, code, name) requests(amount, id, date, value) Task: Retrieve salary from products that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06116
train
v3
Schema: staff (alias: empl)(salary, value, name, level) sales(name, status, level, date) Task: Find amount from staff where salary exceeds the count of amount from sales for the same code. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "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_06117
train
v3
Schema: sales (alias: sale)(name, status, type, amount) regions(date, value, salary, id) Task: Find code from sales where value exceeds the count of amount from regions for the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06118
train
v2
Schema: tasks (alias: tsk)(status, id, date, code) sales(amount, level, date, type) Task: Retrieve id from tasks that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06119
train
v1
Schema: accounts (alias: acct)(value, date, name, level) products(code, value, level, status) Task: Retrieve code from accounts whose status is found in products rows where code matches the outer record. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = acct.code );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06120
train
v2
Schema: departments (alias: dept)(name, date, id, salary) staff(value, status, level, date) Task: Retrieve code from departments that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = dept.id );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06121
train
v2
Schema: employees (alias: emp)(amount, type, value, id) schedules(value, status, type, salary) Task: Find salary from employees where a matching record exists in schedules with the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06122
train
v1
Schema: products (alias: prod)(value, status, salary, date) departments(name, amount, salary, code) Task: Retrieve amount from products whose type is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = prod.type );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06123
train
v1
Schema: orders (alias: ord)(value, date, type, amount) invoices(value, amount, salary, name) Task: Select value from orders where status exists in invoices for the same status. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = ord.status );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06124
train
v1
Schema: departments (alias: dept)(amount, type, code, value) projects(status, code, type, date) Task: Retrieve code from departments whose type is found in projects rows where level matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = dept.level );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06125
train
v3
Schema: orders (alias: ord)(name, status, salary, code) departments(id, type, name, code) Task: Find amount from orders where amount exceeds the total salary from departments for the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.code = ord.code );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06126
train
v2
Schema: projects (alias: prj)(id, name, salary, amount) items(name, level, code, id) Task: Retrieve name from projects that have at least one corresponding entry in items sharing the same code. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "name", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06127
train
v2
Schema: managers (alias: mgr)(amount, type, code, value) items(amount, date, status, type) Task: Find salary from managers where a matching record exists in items with the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = mgr.code );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06128
train
v3
Schema: requests (alias: ordr)(date, status, value, code) categories(code, name, date, value) Task: Retrieve name from requests with value above the COUNT(value) of categories rows sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06129
train
v2
Schema: tasks (alias: tsk)(date, id, level, code) products(level, value, code, date) Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06130
train
v1
Schema: regions (alias: rgn)(salary, level, id, amount) orders(amount, type, name, value) Task: Select amount from regions where status exists in orders for the same type. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06131
train
v2
Schema: projects (alias: prj)(type, salary, id, date) transactions(value, level, date, id) Task: Find value from projects where a matching record exists in transactions with the same type. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = prj.type );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06132
train
v1
Schema: staff (alias: empl)(amount, name, id, date) tasks(name, id, value, amount) Task: Select code from staff where type exists in tasks for the same id. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = empl.id );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06133
train
v2
Schema: managers (alias: mgr)(date, value, code, id) customers(salary, status, name, level) Task: Retrieve name from managers that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06134
train
v3
Schema: employees (alias: emp)(value, id, status, type) schedules(id, amount, salary, type) Task: Retrieve value from employees with salary above the SUM(salary) of schedules rows sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06135
train
v3
Schema: departments (alias: dept)(id, date, code, type) schedules(status, date, salary, value) Task: Retrieve id from departments with value above the SUM(value) of schedules rows sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06136
train
v3
Schema: items (alias: lne)(date, salary, id, type) tasks(amount, level, id, salary) Task: Retrieve code from items with value above the MAX(value) of tasks rows sharing the same level. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06137
train
v1
Schema: schedules (alias: schd)(status, value, id, date) items(id, value, status, amount) Task: Retrieve code from schedules whose level is found in items rows where level matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06138
train
v1
Schema: projects (alias: prj)(amount, status, id, value) shipments(name, salary, status, level) Task: Select salary from projects where code exists in shipments for the same id. SQL:
SELECT salary FROM projects AS prj WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = prj.id );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06139
train
v2
Schema: accounts (alias: acct)(id, level, value, date) departments(amount, salary, level, date) Task: Find salary from accounts where a matching record exists in departments with the same id. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06140
train
v2
Schema: branches (alias: brc)(amount, type, value, id) managers(code, level, id, amount) Task: Retrieve code from branches that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = brc.code );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06141
train
v3
Schema: items (alias: lne)(amount, level, status, name) invoices(status, id, name, type) Task: Find code from items where salary exceeds the minimum amount from invoices for the same status. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06142
train
v3
Schema: tasks (alias: tsk)(salary, amount, code, type) projects(date, salary, status, type) Task: Retrieve amount from tasks with salary above the MIN(amount) of projects rows sharing the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06143
train
v3
Schema: categories (alias: catg)(id, status, level, salary) items(amount, salary, id, type) Task: Find value from categories where amount exceeds the minimum amount from items for the same type. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT MIN(amount) FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06144
train
v3
Schema: accounts (alias: acct)(code, date, status, id) employees(date, salary, value, name) Task: Find value from accounts where value exceeds the count of value from employees for the same status. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06145
train
v3
Schema: categories (alias: catg)(date, level, type, name) transactions(date, amount, status, id) Task: Find salary from categories where amount exceeds the average amount from transactions for the same code. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06146
train
v2
Schema: transactions (alias: txn)(value, amount, date, type) staff(date, value, level, salary) Task: Retrieve salary from transactions that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = txn.status );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06147
train
v2
Schema: shipments (alias: shp)(status, code, id, amount) categories(id, date, amount, code) Task: Find name from shipments where a matching record exists in categories with the same code. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = shp.code );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06148
train
v1
Schema: employees (alias: emp)(status, level, date, value) items(value, name, type, code) Task: Retrieve code from employees whose level is found in items rows where status matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06149
train
v3
Schema: orders (alias: ord)(id, amount, salary, name) projects(id, level, type, value) Task: Retrieve code from orders with salary above the AVG(amount) of projects rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT AVG(amount) FROM projects AS prj WHERE prj.id = ord.id );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06150
train
v2
Schema: sales (alias: sale)(value, date, type, code) regions(name, id, type, level) Task: Find name from sales where a matching record exists in regions with the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06151
train
v2
Schema: items (alias: lne)(salary, id, value, date) tasks(type, id, salary, date) Task: Find salary from items where a matching record exists in tasks with the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = lne.id );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06152
train
v2
Schema: transactions (alias: txn)(status, code, id, salary) departments(date, name, code, amount) Task: Find salary from transactions where a matching record exists in departments with the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = txn.code );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06153
train
v1
Schema: employees (alias: emp)(amount, code, value, name) managers(amount, salary, value, code) Task: Select amount from employees where id exists in managers for the same code. SQL:
SELECT amount FROM employees AS emp WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06154
train
v3
Schema: orders (alias: ord)(level, type, code, date) projects(name, type, amount, id) Task: Retrieve name from orders with amount above the SUM(amount) of projects rows sharing the same code. SQL:
SELECT name FROM orders AS ord WHERE amount > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.code = ord.code );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06155
train
v3
Schema: branches (alias: brc)(salary, date, id, status) sales(date, code, type, amount) Task: Retrieve value from branches with amount above the SUM(salary) of sales rows sharing the same status. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.status = brc.status );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06156
train
v1
Schema: managers (alias: mgr)(code, value, salary, id) invoices(level, date, status, name) Task: Select amount from managers where code exists in invoices for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = mgr.id );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06157
train
v2
Schema: branches (alias: brc)(salary, date, value, name) departments(amount, value, status, date) Task: Retrieve value from branches that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = brc.id );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "value", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06158
train
v3
Schema: transactions (alias: txn)(date, level, code, salary) departments(level, status, id, date) Task: Retrieve amount from transactions with value above the MAX(amount) of departments rows sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.level = txn.level );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06159
train
v1
Schema: products (alias: prod)(value, name, amount, id) customers(status, id, salary, date) Task: Find value from products where level appears in customers entries with matching code. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06160
train
v3
Schema: items (alias: lne)(type, value, code, amount) requests(status, id, level, type) Task: Retrieve value from items with value above the AVG(value) of requests rows sharing the same level. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06161
train
v1
Schema: categories (alias: catg)(salary, amount, date, level) accounts(id, date, value, status) Task: Find salary from categories where id appears in accounts entries with matching id. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06162
train
v1
Schema: requests (alias: ordr)(id, name, amount, level) departments(date, name, id, code) Task: Select code from requests where status exists in departments for the same type. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06163
train
v3
Schema: shipments (alias: shp)(name, amount, id, level) branches(salary, level, name, type) Task: Find name from shipments where salary exceeds the average value from branches for the same code. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT AVG(value) FROM branches AS brc WHERE brc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06164
train
v3
Schema: requests (alias: ordr)(salary, level, amount, code) invoices(value, code, salary, level) Task: Find salary from requests where value exceeds the count of value from invoices for the same code. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06165
train
v2
Schema: sales (alias: sale)(status, salary, id, name) orders(status, amount, date, name) Task: Find code from sales where a matching record exists in orders with the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = sale.id );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06166
train
v1
Schema: projects (alias: prj)(salary, type, level, date) branches(date, name, amount, type) Task: Find amount from projects where id appears in branches entries with matching id. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = prj.id );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06167
train
v1
Schema: orders (alias: ord)(type, value, salary, amount) staff(code, level, type, salary) Task: Retrieve id from orders whose type is found in staff rows where type matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06168
train
v1
Schema: orders (alias: ord)(date, code, status, type) managers(name, amount, id, value) Task: Find salary from orders where id appears in managers entries with matching code. SQL:
SELECT salary FROM orders AS ord WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06169
train
v3
Schema: sales (alias: sale)(code, amount, status, type) transactions(level, salary, id, code) Task: Retrieve code from sales with salary above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06170
train
v3
Schema: invoices (alias: inv)(salary, date, amount, type) products(name, code, level, status) Task: Find amount from invoices where amount exceeds the minimum value from products for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06171
train
v1
Schema: branches (alias: brc)(amount, level, date, value) customers(value, code, salary, amount) Task: Find code from branches where id appears in customers entries with matching level. SQL:
SELECT code FROM branches AS brc WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = brc.level );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06172
train
v1
Schema: accounts (alias: acct)(value, date, code, amount) schedules(level, date, id, value) Task: Find id from accounts where id appears in schedules entries with matching id. SQL:
SELECT id FROM accounts AS acct WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06173
train
v3
Schema: transactions (alias: txn)(amount, value, date, status) orders(date, level, status, code) Task: Find salary from transactions where salary exceeds the maximum value from orders for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06174
train
v2
Schema: regions (alias: rgn)(type, value, name, id) shipments(salary, code, status, value) Task: Find code from regions where a matching record exists in shipments with the same level. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06175
train
v1
Schema: departments (alias: dept)(salary, value, code, name) transactions(name, id, level, code) Task: Retrieve code from departments whose type is found in transactions rows where type matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06176
train
v3
Schema: sales (alias: sale)(name, code, date, type) products(level, salary, value, id) Task: Retrieve salary from sales with salary above the SUM(amount) of products rows sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM products AS prod WHERE prod.code = sale.code );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06177
train
v1
Schema: shipments (alias: shp)(level, name, date, salary) requests(level, amount, status, value) Task: Find amount from shipments where id appears in requests entries with matching level. SQL:
SELECT amount FROM shipments AS shp WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06178
train
v3
Schema: orders (alias: ord)(type, salary, name, level) schedules(salary, date, amount, value) Task: Retrieve value from orders with salary above the AVG(salary) of schedules rows sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06179
train
v3
Schema: tasks (alias: tsk)(salary, level, id, type) projects(date, id, code, status) Task: Find amount from tasks where amount exceeds the total amount from projects for the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE amount > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06180
train
v2
Schema: items (alias: lne)(id, type, code, name) departments(amount, type, id, date) Task: Retrieve code from items that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06181
train
v2
Schema: departments (alias: dept)(date, value, status, amount) employees(date, salary, name, status) Task: Retrieve name from departments that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06182
train
v1
Schema: customers (alias: cust)(salary, amount, date, id) employees(amount, name, value, level) Task: Select amount from customers where id exists in employees for the same status. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06183
train
v3
Schema: shipments (alias: shp)(name, id, level, status) branches(date, salary, value, level) Task: Find id from shipments where value exceeds the minimum salary from branches for the same status. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.status = shp.status );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06184
train
v2
Schema: regions (alias: rgn)(level, type, code, date) projects(id, code, date, status) Task: Retrieve value from regions that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = rgn.code );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "value", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06185
train
v3
Schema: employees (alias: emp)(salary, date, code, type) orders(type, id, amount, date) Task: Retrieve value from employees with value above the SUM(salary) of orders rows sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06186
train
v1
Schema: accounts (alias: acct)(level, status, date, amount) projects(salary, id, amount, level) Task: Select code from accounts where status exists in projects for the same type. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.type = acct.type );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06187
train
v2
Schema: orders (alias: ord)(level, date, name, salary) transactions(amount, date, id, code) Task: Retrieve name from orders that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "name", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06188
train
v3
Schema: projects (alias: prj)(name, date, code, level) shipments(name, amount, value, code) Task: Find id from projects where salary exceeds the average salary from shipments for the same level. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.level = prj.level );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06189
train
v1
Schema: sales (alias: sale)(status, type, name, amount) projects(salary, status, date, id) Task: Retrieve salary from sales whose id is found in projects rows where status matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06190
train
v2
Schema: schedules (alias: schd)(value, date, salary, status) regions(status, salary, code, date) Task: Retrieve amount from schedules that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06191
train
v2
Schema: requests (alias: ordr)(status, level, code, name) branches(date, status, type, code) Task: Retrieve salary from requests that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06192
train
v1
Schema: regions (alias: rgn)(value, id, amount, level) projects(date, amount, level, salary) Task: Find salary from regions where type appears in projects entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.code = rgn.code );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06193
train
v2
Schema: projects (alias: prj)(code, date, type, name) schedules(code, value, name, status) Task: Retrieve name from projects that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = prj.id );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06194
train
v3
Schema: invoices (alias: inv)(value, code, status, level) products(code, date, status, salary) Task: Retrieve code from invoices with salary above the COUNT(salary) of products rows sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06195
train
v3
Schema: departments (alias: dept)(amount, name, code, level) transactions(id, value, type, salary) Task: Retrieve name from departments with value above the MAX(amount) of transactions rows sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06196
train
v3
Schema: branches (alias: brc)(salary, status, id, code) staff(date, value, id, amount) Task: Find name from branches where value exceeds the minimum amount from staff for the same id. SQL:
SELECT name FROM branches AS brc WHERE value > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.id = brc.id );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06197
train
v3
Schema: regions (alias: rgn)(id, type, amount, salary) accounts(level, name, salary, date) Task: Retrieve salary from regions with value above the COUNT(salary) of accounts rows sharing the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.level = rgn.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06198
train
v3
Schema: invoices (alias: inv)(value, type, code, date) regions(amount, code, status, salary) Task: Find amount from invoices where value exceeds the total salary from regions for the same level. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06199
train