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: items (alias: lne)(salary, code, amount, value) tasks(type, date, status, level) Task: Find salary from items where value exceeds the count of amount from tasks for the same id. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.id = lne.id );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14300
train
v3
Schema: accounts (alias: acct)(salary, code, status, amount) projects(code, date, level, salary) Task: Find id from accounts where value exceeds the total salary from projects for the same code. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14301
train
v2
Schema: customers (alias: cust)(value, type, date, level) branches(status, amount, salary, value) Task: Find code from customers where a matching record exists in branches with the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = cust.type );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14302
train
v2
Schema: categories (alias: catg)(amount, value, id, code) transactions(name, salary, code, date) Task: Find value from categories where a matching record exists in transactions with the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14303
train
v1
Schema: projects (alias: prj)(status, salary, value, name) categories(code, id, amount, salary) Task: Select value from projects where code exists in categories for the same type. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14304
train
v3
Schema: accounts (alias: acct)(status, salary, value, code) projects(status, type, name, amount) Task: Retrieve id from accounts with value above the MIN(salary) of projects rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14305
train
v2
Schema: categories (alias: catg)(value, salary, id, type) shipments(status, value, name, id) Task: Retrieve salary from categories that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14306
train
v3
Schema: orders (alias: ord)(amount, date, value, type) products(name, date, type, id) Task: Retrieve amount from orders with amount above the AVG(value) of products rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT AVG(value) FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14307
train
v3
Schema: shipments (alias: shp)(level, id, salary, name) orders(status, date, code, value) Task: Retrieve amount from shipments with value above the SUM(amount) of orders rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14308
train
v1
Schema: sales (alias: sale)(type, status, code, level) departments(status, id, value, code) Task: Select name from sales where type exists in departments for the same status. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14309
train
v2
Schema: orders (alias: ord)(date, salary, status, name) regions(salary, amount, value, date) Task: Retrieve id from orders that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14310
train
v1
Schema: categories (alias: catg)(level, type, salary, status) invoices(status, type, name, value) Task: Find id from categories where id appears in invoices entries with matching id. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14311
train
v3
Schema: invoices (alias: inv)(date, code, salary, type) tasks(level, code, status, value) Task: Find value from invoices where value exceeds the average salary from tasks for the same id. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14312
train
v2
Schema: items (alias: lne)(type, value, salary, code) products(code, date, level, name) Task: Retrieve value from items that have at least one corresponding entry in products sharing the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = lne.status );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14313
train
v2
Schema: customers (alias: cust)(amount, status, name, value) tasks(type, value, level, code) Task: Find amount from customers where a matching record exists in tasks with the same code. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = cust.code );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "amount", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14314
train
v2
Schema: products (alias: prod)(id, date, code, amount) managers(salary, amount, id, status) Task: Find salary from products where a matching record exists in managers with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14315
train
v2
Schema: branches (alias: brc)(id, value, status, date) tasks(name, id, code, type) Task: Find id from branches where a matching record exists in tasks with the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = brc.status );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14316
train
v3
Schema: employees (alias: emp)(code, level, value, id) products(code, salary, status, type) Task: Find value from employees where value exceeds the count of amount from products for the same level. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.level = emp.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14317
train
v1
Schema: orders (alias: ord)(code, type, value, id) customers(id, type, status, code) Task: Select id from orders where id exists in customers for the same type. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.type = ord.type );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14318
train
v2
Schema: tasks (alias: tsk)(amount, name, status, level) shipments(level, code, type, salary) Task: Retrieve name from tasks that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "name", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14319
train
v2
Schema: tasks (alias: tsk)(value, amount, type, date) categories(status, amount, level, value) Task: Find code from tasks where a matching record exists in categories with the same id. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14320
train
v3
Schema: tasks (alias: tsk)(status, name, type, date) regions(level, type, code, status) Task: Find name from tasks where value exceeds the total value from regions for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14321
train
v3
Schema: staff (alias: empl)(amount, status, salary, value) branches(name, status, amount, type) Task: Find id from staff where amount exceeds the minimum value from branches for the same level. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MIN(value) FROM branches AS brc WHERE brc.level = empl.level );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14322
train
v2
Schema: departments (alias: dept)(status, amount, date, value) invoices(type, value, id, name) Task: Retrieve amount from departments that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14323
train
v3
Schema: products (alias: prod)(date, id, value, name) shipments(value, salary, level, type) Task: Find code from products where value exceeds the maximum salary from shipments for the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14324
train
v2
Schema: branches (alias: brc)(value, id, name, status) employees(value, type, amount, id) Task: Retrieve salary from branches that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = brc.id );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14325
train
v1
Schema: schedules (alias: schd)(level, name, date, salary) products(name, code, status, date) Task: Retrieve name from schedules whose code is found in products rows where type matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14326
train
v1
Schema: employees (alias: emp)(status, level, value, name) accounts(amount, date, name, value) Task: Find value from employees where code appears in accounts entries with matching level. SQL:
SELECT value FROM employees AS emp WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14327
train
v1
Schema: branches (alias: brc)(date, type, name, id) categories(name, date, level, code) Task: Select name from branches where code exists in categories for the same id. SQL:
SELECT name FROM branches AS brc WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = brc.id );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14328
train
v2
Schema: categories (alias: catg)(date, amount, id, value) schedules(salary, code, level, amount) Task: Find code from categories where a matching record exists in schedules with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14329
train
v2
Schema: requests (alias: ordr)(status, amount, code, type) schedules(code, level, name, amount) Task: Find id from requests where a matching record exists in schedules with the same code. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14330
train
v2
Schema: sales (alias: sale)(amount, code, name, status) departments(type, salary, id, status) Task: Retrieve name from sales that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = sale.id );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14331
train
v1
Schema: accounts (alias: acct)(salary, type, id, value) customers(name, level, date, salary) Task: Find salary from accounts where status appears in customers entries with matching type. SQL:
SELECT salary FROM accounts AS acct WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14332
train
v1
Schema: sales (alias: sale)(amount, code, salary, date) transactions(code, level, value, name) Task: Find id from sales where status appears in transactions entries with matching type. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status 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": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14333
train
v3
Schema: requests (alias: ordr)(status, salary, date, id) regions(type, value, salary, id) Task: Retrieve id from requests with amount above the MIN(amount) of regions rows sharing the same code. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14334
train
v3
Schema: regions (alias: rgn)(code, value, status, level) transactions(level, value, date, code) Task: Find salary from regions where value exceeds the maximum amount from transactions for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14335
train
v3
Schema: categories (alias: catg)(value, level, code, type) projects(type, id, code, date) Task: Find name from categories where value exceeds the minimum value from projects for the same status. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT MIN(value) FROM projects AS prj WHERE prj.status = catg.status );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14336
train
v1
Schema: products (alias: prod)(code, amount, name, level) tasks(code, type, level, name) Task: Retrieve id from products whose id is found in tasks rows where code matches the outer record. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = prod.code );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14337
train
v1
Schema: requests (alias: ordr)(level, status, date, code) schedules(amount, name, type, salary) Task: Select id from requests where level exists in schedules for the same code. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14338
train
v1
Schema: requests (alias: ordr)(status, date, amount, level) projects(level, name, date, status) Task: Retrieve code from requests whose status is found in projects rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = ordr.id );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14339
train
v2
Schema: products (alias: prod)(salary, value, id, level) invoices(status, value, code, name) Task: Retrieve code from products that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14340
train
v2
Schema: staff (alias: empl)(status, level, type, value) requests(value, type, id, level) Task: Retrieve amount from staff that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = empl.type );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14341
train
v2
Schema: managers (alias: mgr)(value, salary, type, level) projects(date, salary, id, value) Task: Find name from managers where a matching record exists in projects with the same status. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = mgr.status );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14342
train
v3
Schema: managers (alias: mgr)(level, id, value, salary) staff(status, amount, value, salary) Task: Retrieve value from managers with amount above the SUM(amount) of staff rows sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14343
train
v3
Schema: products (alias: prod)(salary, status, code, level) invoices(date, amount, type, id) Task: Find code from products where salary exceeds the maximum value from invoices for the same level. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14344
train
v2
Schema: requests (alias: ordr)(id, status, value, name) categories(date, name, status, salary) Task: Retrieve name from requests that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14345
train
v1
Schema: staff (alias: empl)(type, date, name, amount) customers(name, status, id, code) Task: Find amount from staff where id appears in customers entries with matching code. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = empl.code );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14346
train
v1
Schema: sales (alias: sale)(salary, status, amount, name) categories(status, code, type, id) Task: Retrieve name from sales whose level is found in categories rows where level matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14347
train
v1
Schema: sales (alias: sale)(date, name, amount, id) branches(status, value, id, type) Task: Select name from sales where id exists in branches for the same status. SQL:
SELECT name FROM sales AS sale WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = sale.status );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14348
train
v1
Schema: departments (alias: dept)(level, value, name, amount) regions(value, type, salary, level) Task: Find amount from departments where type appears in regions entries with matching type. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14349
train
v2
Schema: staff (alias: empl)(name, salary, code, date) employees(salary, name, level, value) Task: Find salary from staff where a matching record exists in employees with the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = empl.status );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14350
train
v2
Schema: accounts (alias: acct)(value, level, status, date) managers(value, level, amount, id) Task: Retrieve amount from accounts that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14351
train
v2
Schema: items (alias: lne)(value, id, amount, level) categories(name, date, code, salary) Task: Find amount from items where a matching record exists in categories with the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = lne.level );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14352
train
v1
Schema: invoices (alias: inv)(name, type, date, code) tasks(value, salary, status, type) Task: Find amount from invoices where level appears in tasks entries with matching code. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = inv.code );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14353
train
v1
Schema: schedules (alias: schd)(type, status, salary, date) sales(status, level, salary, id) Task: Retrieve salary from schedules whose level is found in sales rows where type matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14354
train
v1
Schema: managers (alias: mgr)(amount, name, id, type) requests(salary, value, amount, date) Task: Retrieve code from managers whose type is found in requests rows where status matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = mgr.status );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14355
train
v3
Schema: managers (alias: mgr)(type, value, salary, level) customers(type, id, amount, code) Task: Retrieve name from managers with value above the COUNT(salary) of customers rows sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.level = mgr.level );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14356
train
v3
Schema: accounts (alias: acct)(name, salary, amount, status) items(id, value, date, salary) Task: Find salary from accounts where value exceeds the total value from items for the same type. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT SUM(value) FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14357
train
v2
Schema: products (alias: prod)(date, type, id, status) transactions(name, date, amount, code) Task: Find amount from products where a matching record exists in transactions with the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14358
train
v1
Schema: regions (alias: rgn)(level, id, status, value) schedules(amount, salary, name, code) Task: Select amount from regions where status exists in schedules for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14359
train
v2
Schema: items (alias: lne)(code, value, status, date) requests(value, id, date, amount) Task: Find value from items where a matching record exists in requests with the same id. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14360
train
v1
Schema: invoices (alias: inv)(id, salary, type, status) products(level, code, id, value) Task: Find value from invoices where status appears in products entries with matching code. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14361
train
v1
Schema: customers (alias: cust)(type, name, amount, id) tasks(salary, name, id, code) Task: Find name from customers where status appears in tasks entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.type = cust.type );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14362
train
v2
Schema: requests (alias: ordr)(name, date, amount, value) schedules(amount, status, date, id) Task: Retrieve value from requests that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ordr.level );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14363
train
v3
Schema: sales (alias: sale)(value, date, amount, code) staff(level, salary, value, name) Task: Retrieve code from sales with salary above the SUM(value) of staff rows sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14364
train
v2
Schema: items (alias: lne)(name, type, id, date) products(name, value, salary, code) Task: Retrieve name from items that have at least one corresponding entry in products sharing the same status. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = lne.status );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "name", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14365
train
v2
Schema: accounts (alias: acct)(value, amount, type, level) requests(date, type, name, salary) Task: Find value from accounts where a matching record exists in requests with the same id. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14366
train
v1
Schema: products (alias: prod)(type, salary, status, amount) items(id, salary, value, date) Task: Find salary from products where status appears in items entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14367
train
v1
Schema: branches (alias: brc)(salary, type, value, amount) requests(code, amount, status, type) Task: Find id from branches where status appears in requests entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = brc.code );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14368
train
v2
Schema: projects (alias: prj)(date, code, salary, status) shipments(code, date, id, name) Task: Retrieve name from projects that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = prj.code );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "name", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14369
train
v2
Schema: tasks (alias: tsk)(amount, salary, value, date) requests(value, status, name, id) Task: Retrieve value from tasks that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "value", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14370
train
v3
Schema: tasks (alias: tsk)(salary, type, id, level) sales(code, id, status, salary) Task: Retrieve code from tasks with value above the AVG(amount) of sales rows sharing the same code. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14371
train
v1
Schema: items (alias: lne)(date, type, name, salary) accounts(id, type, name, code) Task: Find code from items where code appears in accounts entries with matching status. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = lne.status );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14372
train
v3
Schema: employees (alias: emp)(level, salary, code, id) managers(salary, id, level, value) Task: Retrieve value from employees with salary above the MAX(value) of managers rows sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14373
train
v3
Schema: shipments (alias: shp)(amount, status, salary, name) departments(code, amount, name, level) Task: Find value from shipments where value exceeds the minimum salary from departments for the same code. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14374
train
v2
Schema: requests (alias: ordr)(date, level, type, value) categories(salary, code, type, id) Task: Find salary from requests where a matching record exists in categories with the same code. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = ordr.code );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14375
train
v2
Schema: transactions (alias: txn)(amount, status, id, salary) requests(date, name, id, status) Task: Find id from transactions where a matching record exists in requests with the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14376
train
v3
Schema: employees (alias: emp)(status, type, amount, id) regions(name, type, level, date) Task: Find salary from employees where amount exceeds the average amount from regions for the same status. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14377
train
v2
Schema: transactions (alias: txn)(level, status, name, amount) branches(status, name, amount, code) Task: Retrieve amount from transactions that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14378
train
v1
Schema: regions (alias: rgn)(code, amount, status, salary) departments(date, status, name, value) Task: Retrieve id from regions whose level is found in departments rows where id matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = rgn.id );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14379
train
v3
Schema: departments (alias: dept)(level, name, value, code) managers(salary, level, status, name) Task: Find amount from departments where salary exceeds the total salary from managers for the same type. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14380
train
v2
Schema: products (alias: prod)(amount, value, code, salary) projects(id, name, type, value) Task: Retrieve amount from products that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = prod.code );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14381
train
v3
Schema: schedules (alias: schd)(value, salary, type, amount) managers(id, status, code, value) Task: Find name from schedules where value exceeds the count of value from managers for the same id. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14382
train
v2
Schema: orders (alias: ord)(value, salary, date, code) staff(date, level, salary, value) Task: Find value from orders where a matching record exists in staff with the same status. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ord.status );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "value", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14383
train
v3
Schema: shipments (alias: shp)(salary, level, name, date) transactions(status, code, type, date) Task: Retrieve salary from shipments with salary above the MAX(salary) of transactions rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MAX(salary) 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": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14384
train
v2
Schema: requests (alias: ordr)(code, date, status, salary) departments(salary, amount, level, status) Task: Find salary from requests where a matching record exists in departments with the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14385
train
v2
Schema: shipments (alias: shp)(value, name, id, code) categories(type, id, status, level) Task: Retrieve salary from shipments that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT salary 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": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14386
train
v1
Schema: transactions (alias: txn)(id, level, type, salary) orders(amount, name, id, date) Task: Select code from transactions where code exists in orders for the same code. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14387
train
v2
Schema: orders (alias: ord)(salary, amount, level, status) requests(code, type, amount, value) Task: Find code from orders where a matching record exists in requests with the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14388
train
v2
Schema: sales (alias: sale)(id, amount, level, type) branches(amount, salary, name, code) Task: Find id from sales where a matching record exists in branches with the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = sale.type );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14389
train
v3
Schema: shipments (alias: shp)(code, date, status, salary) regions(type, name, status, date) Task: Retrieve code from shipments with salary above the MIN(salary) of regions rows sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14390
train
v3
Schema: shipments (alias: shp)(type, level, name, status) invoices(type, value, name, status) Task: Retrieve value from shipments with salary above the MAX(value) of invoices rows sharing the same code. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14391
train
v3
Schema: employees (alias: emp)(id, salary, value, status) categories(level, amount, date, code) Task: Find value from employees where value exceeds the average salary from categories for the same id. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.id = emp.id );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14392
train
v2
Schema: customers (alias: cust)(value, status, level, id) schedules(date, amount, value, status) Task: Find name from customers where a matching record exists in schedules with the same id. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = cust.id );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14393
train
v1
Schema: transactions (alias: txn)(date, code, level, type) sales(status, salary, date, name) Task: Retrieve name from transactions whose status is found in sales rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14394
train
v3
Schema: accounts (alias: acct)(date, level, amount, type) requests(name, date, amount, id) Task: Find id from accounts where amount exceeds the minimum value from requests for the same level. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14395
train
v3
Schema: categories (alias: catg)(name, salary, amount, date) staff(status, level, amount, type) Task: Find id from categories where salary exceeds the count of amount from staff for the same level. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14396
train
v3
Schema: transactions (alias: txn)(type, code, level, id) invoices(type, salary, level, value) Task: Retrieve salary from transactions with amount above the COUNT(value) of invoices rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14397
train
v2
Schema: categories (alias: catg)(amount, date, id, status) sales(salary, amount, date, status) Task: Retrieve name from categories that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = catg.level );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14398
train
v1
Schema: invoices (alias: inv)(value, code, name, date) customers(id, date, level, name) Task: Find value from invoices where code appears in customers entries with matching type. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14399
train