variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v1
Schema: accounts (alias: acct)(code, value, salary, level) managers(amount, status, value, level) Task: Select code from accounts where status exists in managers for the same code. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14200
train
v2
Schema: employees (alias: emp)(code, status, amount, level) departments(level, id, date, type) Task: Retrieve code from employees that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14201
train
v1
Schema: branches (alias: brc)(name, amount, level, id) tasks(salary, amount, type, id) Task: Retrieve amount from branches whose level is found in tasks rows where id matches the outer record. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.id = brc.id );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14202
train
v3
Schema: projects (alias: prj)(status, type, date, amount) categories(status, date, code, level) Task: Find id from projects where value exceeds the count of salary from categories for the same type. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14203
train
v3
Schema: customers (alias: cust)(type, id, status, date) categories(code, id, salary, value) Task: Retrieve salary from customers with amount above the MIN(amount) of categories rows sharing the same level. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14204
train
v1
Schema: requests (alias: ordr)(amount, date, name, value) projects(status, salary, id, value) Task: Find name from requests where code appears in projects entries with matching status. SQL:
SELECT name FROM requests AS ordr WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.status = ordr.status );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14205
train
v2
Schema: shipments (alias: shp)(status, type, value, level) customers(level, amount, type, status) Task: Find id from shipments where a matching record exists in customers with the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14206
train
v1
Schema: items (alias: lne)(code, level, value, amount) staff(name, value, code, status) Task: Retrieve value from items whose type is found in staff rows where code matches the outer record. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14207
train
v1
Schema: requests (alias: ordr)(code, type, name, value) projects(type, salary, date, level) Task: Find code from requests where level appears in projects entries with matching level. SQL:
SELECT code FROM requests AS ordr WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14208
train
v2
Schema: invoices (alias: inv)(code, salary, date, status) branches(amount, id, level, type) Task: Find value from invoices where a matching record exists in branches with the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = inv.level );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14209
train
v2
Schema: tasks (alias: tsk)(code, id, status, amount) managers(date, name, salary, level) Task: Find salary from tasks where a matching record exists in managers with the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14210
train
v1
Schema: products (alias: prod)(type, date, status, level) branches(status, id, code, date) Task: Find code from products where type appears in branches entries with matching status. SQL:
SELECT code FROM products AS prod WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14211
train
v3
Schema: branches (alias: brc)(level, value, type, amount) sales(status, type, value, salary) Task: Retrieve code from branches with amount above the AVG(value) of sales rows sharing the same code. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.code = brc.code );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14212
train
v2
Schema: items (alias: lne)(salary, date, amount, name) customers(salary, id, date, code) Task: Retrieve id from items that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14213
train
v3
Schema: orders (alias: ord)(status, amount, value, name) products(id, type, code, status) Task: Find salary from orders where salary exceeds the maximum value from products for the same id. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT MAX(value) FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14214
train
v3
Schema: invoices (alias: inv)(name, value, date, level) schedules(name, type, date, value) Task: Find name from invoices where value exceeds the minimum amount from schedules for the same code. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14215
train
v3
Schema: shipments (alias: shp)(name, amount, date, id) accounts(type, amount, code, value) Task: Retrieve name from shipments with amount above the MAX(amount) of accounts rows sharing the same id. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14216
train
v1
Schema: customers (alias: cust)(status, value, name, level) requests(date, salary, type, name) Task: Select id from customers where level exists in requests for the same type. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14217
train
v1
Schema: invoices (alias: inv)(code, date, name, type) sales(date, status, value, level) Task: Select code from invoices where type exists in sales for the same type. SQL:
SELECT code FROM invoices AS inv WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14218
train
v3
Schema: categories (alias: catg)(code, level, id, status) accounts(value, type, date, id) Task: Find amount from categories where value exceeds the minimum salary from accounts for the same code. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14219
train
v3
Schema: branches (alias: brc)(type, code, value, salary) customers(salary, level, value, type) Task: Find code from branches where amount exceeds the maximum value from customers for the same code. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.code = brc.code );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14220
train
v3
Schema: employees (alias: emp)(status, salary, date, code) shipments(id, name, amount, salary) Task: Retrieve name from employees with value above the SUM(value) of shipments rows sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14221
train
v3
Schema: sales (alias: sale)(value, salary, id, type) transactions(amount, type, date, value) Task: Retrieve id from sales with value above the COUNT(amount) of transactions rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14222
train
v3
Schema: regions (alias: rgn)(id, value, level, salary) categories(salary, value, name, amount) Task: Retrieve value from regions with salary above the AVG(salary) of categories rows sharing the same level. SQL:
SELECT value FROM regions AS rgn WHERE salary > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14223
train
v3
Schema: regions (alias: rgn)(name, value, date, code) branches(amount, status, id, type) Task: Retrieve code from regions with salary above the MIN(salary) of branches rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14224
train
v1
Schema: invoices (alias: inv)(status, level, date, id) branches(value, type, amount, date) Task: Retrieve amount from invoices whose status is found in branches rows where level matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = inv.level );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14225
train
v2
Schema: tasks (alias: tsk)(amount, code, date, id) accounts(id, type, value, status) Task: Find value from tasks where a matching record exists in accounts with the same type. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14226
train
v3
Schema: requests (alias: ordr)(type, date, code, name) departments(salary, value, name, level) Task: Retrieve salary from requests with amount above the COUNT(amount) of departments rows sharing the same type. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14227
train
v3
Schema: tasks (alias: tsk)(salary, value, level, id) requests(date, code, type, salary) Task: Retrieve code from tasks with salary above the COUNT(amount) of requests rows sharing the same id. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14228
train
v1
Schema: employees (alias: emp)(name, date, id, amount) orders(value, type, level, amount) Task: Find name from employees where code appears in orders entries with matching id. SQL:
SELECT name FROM employees AS emp WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14229
train
v1
Schema: sales (alias: sale)(date, amount, code, level) regions(id, status, name, type) Task: Select code from sales where id exists in regions for the same status. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14230
train
v1
Schema: shipments (alias: shp)(name, type, code, id) schedules(amount, salary, date, code) Task: Retrieve name from shipments whose code is found in schedules rows where type matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14231
train
v1
Schema: categories (alias: catg)(date, type, salary, id) shipments(status, id, date, code) Task: Retrieve name from categories whose status is found in shipments rows where id matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = catg.id );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14232
train
v2
Schema: customers (alias: cust)(amount, date, id, name) orders(date, name, code, status) Task: Retrieve amount from customers that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = cust.status );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14233
train
v1
Schema: employees (alias: emp)(status, id, salary, level) orders(type, value, level, salary) Task: Retrieve code from employees whose type is found in orders rows where status matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = emp.status );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14234
train
v3
Schema: staff (alias: empl)(date, value, code, level) sales(name, level, id, value) Task: Retrieve value from staff with salary above the COUNT(value) of sales rows sharing the same type. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14235
train
v2
Schema: departments (alias: dept)(value, salary, date, name) managers(level, name, id, salary) Task: Retrieve value from departments that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = dept.status );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14236
train
v3
Schema: customers (alias: cust)(level, type, code, salary) categories(status, id, salary, amount) Task: Find code from customers where salary exceeds the maximum salary from categories for the same type. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.type = cust.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14237
train
v3
Schema: tasks (alias: tsk)(salary, id, name, level) staff(level, value, salary, code) Task: Find id from tasks where salary exceeds the maximum amount from staff for the same id. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14238
train
v3
Schema: departments (alias: dept)(value, level, id, name) sales(id, salary, value, amount) Task: Find name from departments where salary exceeds the total amount from sales for the same level. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14239
train
v2
Schema: schedules (alias: schd)(status, name, amount, salary) departments(value, type, id, status) Task: Find value from schedules where a matching record exists in departments with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14240
train
v3
Schema: customers (alias: cust)(value, type, status, date) invoices(status, id, code, type) Task: Find id from customers where amount exceeds the total amount from invoices for the same level. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14241
train
v2
Schema: schedules (alias: schd)(type, salary, date, id) categories(amount, salary, id, code) Task: Retrieve value from schedules that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14242
train
v2
Schema: schedules (alias: schd)(type, level, status, value) products(type, status, code, date) Task: Retrieve amount from schedules that have at least one corresponding entry in products sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14243
train
v3
Schema: schedules (alias: schd)(level, value, salary, type) regions(amount, value, salary, status) Task: Retrieve code from schedules with value above the COUNT(amount) of regions rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14244
train
v3
Schema: sales (alias: sale)(date, value, status, type) managers(id, salary, code, level) Task: Find salary from sales where salary exceeds the minimum salary from managers for the same type. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14245
train
v1
Schema: invoices (alias: inv)(value, name, status, type) sales(salary, level, amount, status) Task: Find salary from invoices where type appears in sales entries with matching type. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14246
train
v2
Schema: sales (alias: sale)(id, date, name, type) shipments(id, name, type, value) Task: Find value from sales where a matching record exists in shipments with the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14247
train
v1
Schema: orders (alias: ord)(name, date, value, type) tasks(salary, name, value, status) Task: Retrieve amount from orders whose type is found in tasks rows where type matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.type = ord.type );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14248
train
v2
Schema: items (alias: lne)(type, value, status, level) accounts(level, code, name, salary) Task: Retrieve code from items that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT code 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": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14249
train
v1
Schema: managers (alias: mgr)(code, level, amount, date) projects(name, type, salary, value) Task: Retrieve id from managers whose code is found in projects rows where level matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.level = mgr.level );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14250
train
v1
Schema: staff (alias: empl)(amount, code, level, value) employees(code, level, date, status) Task: Retrieve amount from staff whose status is found in employees rows where code matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14251
train
v1
Schema: invoices (alias: inv)(date, status, level, type) staff(id, type, value, salary) Task: Retrieve salary from invoices whose code is found in staff rows where status matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14252
train
v2
Schema: invoices (alias: inv)(code, salary, name, status) employees(level, value, salary, status) Task: Retrieve value from invoices that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14253
train
v3
Schema: categories (alias: catg)(id, type, value, amount) customers(status, date, value, level) Task: Find id from categories where amount exceeds the count of amount from customers for the same code. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14254
train
v2
Schema: products (alias: prod)(name, amount, salary, code) categories(level, id, date, status) Task: Find code from products where a matching record exists in categories with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14255
train
v1
Schema: regions (alias: rgn)(date, type, salary, level) projects(date, type, level, amount) Task: Select name from regions where level exists in projects for the same level. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.level = rgn.level );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14256
train
v3
Schema: departments (alias: dept)(status, salary, level, amount) products(level, code, date, id) Task: Retrieve value from departments with salary above the SUM(amount) of products rows sharing the same id. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT SUM(amount) FROM products AS prod WHERE prod.id = dept.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14257
train
v2
Schema: employees (alias: emp)(id, level, name, type) regions(salary, status, name, code) Task: Retrieve salary from employees that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14258
train
v1
Schema: schedules (alias: schd)(level, type, status, salary) departments(amount, status, name, salary) Task: Retrieve name from schedules whose status is found in departments rows where type matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = schd.type );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14259
train
v3
Schema: requests (alias: ordr)(id, name, status, salary) orders(date, name, code, type) Task: Retrieve salary from requests with value above the SUM(salary) of orders rows sharing the same code. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14260
train
v3
Schema: regions (alias: rgn)(name, value, level, type) products(id, type, salary, code) Task: Find amount from regions where salary exceeds the count of salary from products for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14261
train
v1
Schema: invoices (alias: inv)(type, code, salary, id) customers(id, date, status, level) Task: Find amount from invoices where status appears in customers entries with matching code. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14262
train
v3
Schema: items (alias: lne)(level, status, salary, value) categories(salary, type, level, name) Task: Retrieve value from items with salary above the AVG(value) of categories rows sharing the same type. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT AVG(value) FROM categories AS catg WHERE catg.type = lne.type );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14263
train
v1
Schema: shipments (alias: shp)(amount, status, level, name) transactions(salary, name, id, date) Task: Find salary from shipments where code appears in transactions entries with matching type. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14264
train
v2
Schema: departments (alias: dept)(id, name, value, code) orders(code, id, amount, level) Task: Find code from departments where a matching record exists in orders with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14265
train
v1
Schema: items (alias: lne)(level, value, name, status) projects(salary, date, amount, level) Task: Select amount from items where type exists in projects for the same level. SQL:
SELECT amount FROM items AS lne WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14266
train
v2
Schema: regions (alias: rgn)(id, value, code, salary) customers(salary, amount, name, level) Task: Retrieve salary from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14267
train
v3
Schema: branches (alias: brc)(id, date, value, amount) accounts(level, type, salary, value) Task: Find code from branches where salary exceeds the total amount from accounts for the same id. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.id = brc.id );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14268
train
v1
Schema: projects (alias: prj)(value, level, id, code) managers(date, amount, type, level) Task: Find name from projects where code appears in managers entries with matching level. SQL:
SELECT name FROM projects AS prj WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = prj.level );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14269
train
v1
Schema: sales (alias: sale)(value, date, id, status) departments(value, date, type, salary) Task: Find value from sales where level appears in departments entries with matching level. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = sale.level );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14270
train
v2
Schema: schedules (alias: schd)(id, date, type, status) accounts(level, salary, amount, type) Task: Find id from schedules where a matching record exists in accounts with the same status. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14271
train
v3
Schema: invoices (alias: inv)(salary, level, date, value) regions(type, name, status, date) Task: Find name from invoices where value exceeds the minimum value from regions for the same id. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.id = inv.id );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14272
train
v1
Schema: projects (alias: prj)(name, code, id, status) orders(value, code, salary, status) Task: Find amount from projects where status appears in orders entries with matching status. SQL:
SELECT amount FROM projects AS prj WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = prj.status );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14273
train
v3
Schema: schedules (alias: schd)(name, code, level, amount) requests(salary, date, status, name) Task: Retrieve value from schedules with amount above the MIN(value) of requests rows sharing the same status. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14274
train
v3
Schema: branches (alias: brc)(level, value, name, date) products(amount, date, status, value) Task: Find code from branches where salary exceeds the count of amount from products for the same status. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT COUNT(amount) 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": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14275
train
v3
Schema: projects (alias: prj)(type, value, id, status) departments(code, type, id, value) Task: Find id from projects where amount exceeds the total salary from departments for the same status. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14276
train
v2
Schema: shipments (alias: shp)(date, salary, amount, id) employees(salary, level, code, amount) Task: Find name from shipments where a matching record exists in employees with the same level. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14277
train
v1
Schema: items (alias: lne)(code, type, level, date) regions(status, level, date, value) Task: Select name from items where type exists in regions for the same level. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14278
train
v3
Schema: tasks (alias: tsk)(status, name, level, type) customers(amount, value, date, type) Task: Retrieve name from tasks with amount above the MIN(value) of customers rows sharing the same code. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT MIN(value) FROM customers AS cust WHERE cust.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14279
train
v2
Schema: branches (alias: brc)(name, amount, id, status) transactions(level, status, amount, code) Task: Retrieve id from branches that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = brc.type );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14280
train
v2
Schema: managers (alias: mgr)(date, salary, value, status) invoices(status, value, id, level) Task: Find salary from managers where a matching record exists in invoices with the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = mgr.status );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14281
train
v1
Schema: shipments (alias: shp)(status, id, level, type) products(status, name, id, code) Task: Find code from shipments where code appears in products entries with matching status. SQL:
SELECT code FROM shipments AS shp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14282
train
v3
Schema: tasks (alias: tsk)(salary, amount, value, code) accounts(type, code, name, value) Task: Retrieve salary from tasks with salary above the SUM(amount) of accounts rows sharing the same type. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14283
train
v2
Schema: requests (alias: ordr)(id, type, status, salary) tasks(status, date, id, value) Task: Retrieve amount from requests that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = ordr.level );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14284
train
v1
Schema: sales (alias: sale)(level, value, amount, date) customers(salary, type, date, code) Task: Find code from sales where id appears in customers entries with matching code. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = sale.code );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14285
train
v1
Schema: sales (alias: sale)(salary, amount, name, code) categories(salary, type, code, date) Task: Find code from sales where id appears in categories entries with matching level. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14286
train
v3
Schema: requests (alias: ordr)(date, salary, level, type) invoices(date, type, name, level) Task: Find amount from requests where value exceeds the maximum value from invoices for the same id. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14287
train
v3
Schema: transactions (alias: txn)(type, level, code, amount) schedules(code, level, amount, id) Task: Retrieve id from transactions with salary above the MAX(salary) of schedules rows sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14288
train
v2
Schema: invoices (alias: inv)(status, level, salary, id) transactions(status, name, date, type) Task: Retrieve id from invoices that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14289
train
v1
Schema: schedules (alias: schd)(value, amount, status, id) items(date, status, value, code) Task: Find amount from schedules where code appears in items entries with matching status. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14290
train
v3
Schema: accounts (alias: acct)(status, name, type, date) employees(name, id, level, salary) Task: Retrieve amount from accounts with value above the MAX(salary) of employees rows sharing the same level. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14291
train
v2
Schema: products (alias: prod)(status, date, type, name) tasks(code, name, amount, type) Task: Retrieve value from products that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = prod.status );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14292
train
v1
Schema: managers (alias: mgr)(amount, value, salary, date) shipments(code, status, amount, type) Task: Retrieve value from managers whose level is found in shipments rows where level matches the outer record. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14293
train
v1
Schema: branches (alias: brc)(type, amount, salary, value) sales(id, level, code, amount) Task: Select code from branches where type exists in sales for the same type. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = brc.type );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14294
train
v1
Schema: products (alias: prod)(type, date, name, value) departments(level, name, id, value) Task: Retrieve value from products whose id is found in departments rows where code matches the outer record. SQL:
SELECT value FROM products AS prod WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14295
train
v3
Schema: schedules (alias: schd)(code, level, amount, status) orders(level, status, code, type) Task: Find value from schedules where amount exceeds the maximum salary from orders for the same level. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT MAX(salary) 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": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14296
train
v1
Schema: accounts (alias: acct)(level, name, type, value) schedules(code, status, type, value) Task: Select id from accounts where type exists in schedules for the same id. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type 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": "type", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14297
train
v2
Schema: departments (alias: dept)(id, code, value, status) customers(amount, id, name, type) Task: Retrieve salary from departments that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14298
train
v3
Schema: accounts (alias: acct)(status, date, level, salary) employees(status, name, id, type) Task: Retrieve code from accounts with amount above the AVG(salary) of employees rows sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14299
train