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: products (alias: prod)(type, value, id, name) employees(date, value, type, level) Task: Find value from products where level appears in employees entries with matching level. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.level = prod.level );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02600
train
v3
Schema: invoices (alias: inv)(date, type, salary, name) departments(type, amount, level, date) Task: Retrieve name from invoices with salary above the SUM(salary) of departments rows sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02601
train
v2
Schema: products (alias: prod)(type, level, name, value) categories(id, salary, name, type) Task: Retrieve code from products that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prod.type );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02602
train
v3
Schema: invoices (alias: inv)(id, value, level, status) employees(salary, amount, name, code) Task: Retrieve salary from invoices with salary above the COUNT(value) of employees rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02603
train
v2
Schema: staff (alias: empl)(status, amount, id, salary) regions(level, value, code, type) Task: Retrieve value from staff that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = empl.level );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02604
train
v3
Schema: transactions (alias: txn)(id, status, salary, code) items(id, amount, status, value) Task: Find id from transactions where value exceeds the minimum salary from items for the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(salary) FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02605
train
v3
Schema: requests (alias: ordr)(amount, code, date, salary) shipments(date, id, level, value) Task: Retrieve code from requests with amount above the MAX(amount) of shipments rows sharing the same type. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02606
train
v1
Schema: shipments (alias: shp)(level, type, amount, date) employees(status, amount, salary, name) Task: Retrieve value from shipments whose code is found in employees rows where type matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02607
train
v3
Schema: tasks (alias: tsk)(value, salary, id, level) orders(code, name, amount, type) Task: Retrieve id from tasks with salary above the COUNT(salary) of orders rows sharing the same level. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02608
train
v3
Schema: items (alias: lne)(code, level, salary, value) sales(value, id, type, salary) Task: Retrieve salary from items with amount above the SUM(amount) of sales rows sharing the same level. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.level = lne.level );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02609
train
v2
Schema: requests (alias: ordr)(amount, value, type, code) regions(salary, name, type, status) Task: Retrieve value from requests that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02610
train
v1
Schema: sales (alias: sale)(status, date, name, id) regions(status, value, level, type) Task: Retrieve code from sales whose id is found in regions rows where type matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = sale.type );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02611
train
v3
Schema: transactions (alias: txn)(salary, amount, value, id) orders(level, id, name, amount) Task: Retrieve value from transactions with value above the SUM(salary) of orders rows sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02612
train
v1
Schema: orders (alias: ord)(value, amount, date, id) branches(status, type, amount, id) Task: Find value from orders where type appears in branches entries with matching status. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.status = ord.status );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02613
train
v3
Schema: requests (alias: ordr)(date, type, code, status) orders(id, value, date, level) Task: Retrieve name from requests with value above the COUNT(salary) of orders rows sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02614
train
v3
Schema: sales (alias: sale)(type, salary, code, name) transactions(salary, id, status, type) Task: Retrieve code from sales with salary above the AVG(salary) of transactions rows sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.level = sale.level );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02615
train
v2
Schema: branches (alias: brc)(name, type, status, code) orders(code, level, salary, amount) Task: Find id from branches where a matching record exists in orders with the same level. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = brc.level );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02616
train
v2
Schema: employees (alias: emp)(name, amount, level, type) customers(id, date, type, status) Task: Find value from employees where a matching record exists in customers with the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02617
train
v1
Schema: managers (alias: mgr)(name, date, value, level) tasks(amount, type, salary, code) Task: Find name from managers where status appears in tasks entries with matching status. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.status = mgr.status );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02618
train
v3
Schema: branches (alias: brc)(value, date, type, salary) schedules(salary, type, status, level) Task: Find value from branches where amount exceeds the total salary from schedules for the same type. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.type = brc.type );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02619
train
v1
Schema: projects (alias: prj)(id, date, amount, code) orders(name, amount, status, level) Task: Find value from projects where status appears in orders entries with matching type. SQL:
SELECT value FROM projects AS prj WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = prj.type );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02620
train
v2
Schema: accounts (alias: acct)(level, value, salary, id) departments(amount, code, level, status) Task: Retrieve id from accounts that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02621
train
v2
Schema: employees (alias: emp)(level, value, salary, name) transactions(status, code, salary, date) Task: Find code from employees where a matching record exists in transactions with the same status. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = emp.status );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02622
train
v3
Schema: products (alias: prod)(amount, salary, date, type) shipments(status, amount, level, name) Task: Find name from products where value exceeds the maximum salary from shipments for the same type. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.type = prod.type );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02623
train
v1
Schema: accounts (alias: acct)(name, salary, level, date) requests(value, id, amount, level) Task: Retrieve id from accounts whose type is found in requests rows where type matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02624
train
v2
Schema: sales (alias: sale)(code, salary, value, status) shipments(level, date, status, id) Task: Find code from sales where a matching record exists in shipments with the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02625
train
v1
Schema: products (alias: prod)(type, code, date, status) branches(type, id, name, amount) Task: Select value from products where code exists in branches for the same level. SQL:
SELECT value FROM products AS prod WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.level = prod.level );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02626
train
v3
Schema: managers (alias: mgr)(level, value, status, salary) sales(type, amount, id, date) Task: Find id from managers where amount exceeds the count of amount from sales for the same code. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02627
train
v1
Schema: orders (alias: ord)(salary, status, type, name) sales(level, date, type, value) Task: Retrieve amount from orders whose type is found in sales rows where status matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = ord.status );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02628
train
v3
Schema: projects (alias: prj)(code, status, type, name) regions(type, code, value, amount) Task: Find code from projects where value exceeds the maximum salary from regions for the same type. SQL:
SELECT code FROM projects AS prj WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.type = prj.type );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02629
train
v3
Schema: accounts (alias: acct)(type, salary, status, date) tasks(status, value, type, amount) Task: Find salary from accounts where value exceeds the minimum amount from tasks for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.level = acct.level );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02630
train
v2
Schema: transactions (alias: txn)(level, status, name, value) staff(code, id, level, salary) Task: Find name from transactions where a matching record exists in staff with the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = txn.code );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02631
train
v2
Schema: tasks (alias: tsk)(id, date, name, code) accounts(salary, id, value, date) Task: Retrieve salary from tasks that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary 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": "salary", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02632
train
v3
Schema: staff (alias: empl)(amount, salary, code, status) orders(name, amount, code, value) Task: Retrieve salary from staff with amount above the AVG(amount) of orders rows sharing the same level. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02633
train
v3
Schema: accounts (alias: acct)(id, amount, name, code) items(salary, type, status, amount) Task: Find amount from accounts where amount exceeds the count of salary from items for the same status. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.status = acct.status );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02634
train
v3
Schema: branches (alias: brc)(name, salary, date, id) employees(status, salary, value, code) Task: Retrieve code from branches with value above the MIN(salary) of employees rows sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.level = brc.level );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02635
train
v3
Schema: categories (alias: catg)(level, code, type, amount) products(status, type, id, level) Task: Find value from categories where value exceeds the minimum amount from products for the same id. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02636
train
v1
Schema: orders (alias: ord)(name, date, value, amount) schedules(amount, salary, status, id) Task: Retrieve amount from orders whose level is found in schedules rows where status matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02637
train
v3
Schema: requests (alias: ordr)(date, amount, level, salary) products(amount, date, type, salary) Task: Retrieve name from requests with amount above the SUM(amount) of products rows sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM products AS prod WHERE prod.code = ordr.code );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02638
train
v2
Schema: branches (alias: brc)(id, amount, status, name) transactions(amount, value, name, code) Task: Retrieve code from branches that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = brc.level );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02639
train
v1
Schema: requests (alias: ordr)(level, code, name, type) orders(name, type, status, code) Task: Retrieve name from requests whose status is found in orders rows where level matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02640
train
v2
Schema: regions (alias: rgn)(name, status, date, type) shipments(date, type, status, salary) Task: Retrieve salary from regions that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02641
train
v1
Schema: accounts (alias: acct)(id, date, code, type) departments(value, level, name, status) Task: Retrieve amount from accounts whose status is found in departments rows where code matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = acct.code );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02642
train
v2
Schema: categories (alias: catg)(code, type, date, amount) employees(name, date, level, id) Task: Find name from categories where a matching record exists in employees with the same level. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = catg.level );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02643
train
v1
Schema: orders (alias: ord)(code, type, name, value) regions(salary, amount, status, level) Task: Retrieve value from orders whose type is found in regions rows where code matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = ord.code );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02644
train
v3
Schema: accounts (alias: acct)(level, value, id, salary) schedules(status, level, type, id) Task: Find id from accounts where salary exceeds the minimum amount from schedules for the same code. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02645
train
v3
Schema: requests (alias: ordr)(date, name, level, id) categories(name, salary, type, date) Task: Find id from requests where value exceeds the maximum value from categories for the same id. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "id", "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_02646
train
v3
Schema: accounts (alias: acct)(status, type, id, amount) managers(level, id, type, amount) Task: Retrieve salary from accounts with amount above the AVG(amount) of managers rows sharing the same id. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02647
train
v3
Schema: departments (alias: dept)(salary, type, code, value) requests(name, salary, status, code) Task: Find code from departments where amount exceeds the maximum salary from requests for the same code. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02648
train
v1
Schema: transactions (alias: txn)(name, status, id, salary) accounts(status, amount, level, name) Task: Retrieve salary from transactions whose level is found in accounts rows where type matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02649
train
v2
Schema: customers (alias: cust)(level, date, salary, name) regions(level, type, value, salary) Task: Retrieve amount from customers that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02650
train
v1
Schema: invoices (alias: inv)(amount, id, type, code) branches(value, type, id, level) Task: Retrieve value from invoices whose type is found in branches rows where code matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = inv.code );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02651
train
v2
Schema: products (alias: prod)(level, code, id, status) employees(id, value, amount, salary) Task: Retrieve salary from products that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02652
train
v3
Schema: staff (alias: empl)(name, salary, status, level) requests(salary, level, code, value) Task: Find code from staff where salary exceeds the maximum salary from requests for the same code. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02653
train
v3
Schema: requests (alias: ordr)(name, code, id, level) transactions(date, value, id, name) Task: Find name from requests where value exceeds the count of amount from transactions for the same level. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02654
train
v3
Schema: customers (alias: cust)(level, type, amount, id) projects(status, code, date, id) Task: Find amount from customers where amount exceeds the minimum value from projects for the same status. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT MIN(value) FROM projects AS prj WHERE prj.status = cust.status );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02655
train
v1
Schema: regions (alias: rgn)(salary, status, type, name) items(type, status, salary, id) Task: Select name from regions where level exists in items for the same status. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = rgn.status );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02656
train
v1
Schema: tasks (alias: tsk)(salary, amount, value, status) products(name, id, code, amount) Task: Retrieve code from tasks whose code is found in products rows where code matches the outer record. SQL:
SELECT code FROM tasks AS tsk WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02657
train
v2
Schema: regions (alias: rgn)(type, salary, date, status) customers(type, status, amount, level) Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02658
train
v3
Schema: orders (alias: ord)(amount, id, type, code) requests(salary, value, status, id) Task: Find id from orders where salary exceeds the count of value from requests for the same id. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.id = ord.id );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02659
train
v1
Schema: invoices (alias: inv)(code, amount, level, type) projects(id, date, amount, status) Task: Retrieve id from invoices whose level is found in projects rows where type matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02660
train
v3
Schema: products (alias: prod)(status, level, value, type) employees(status, date, name, level) Task: Retrieve code from products with salary above the AVG(amount) of employees rows sharing the same status. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02661
train
v1
Schema: orders (alias: ord)(code, type, date, level) invoices(id, status, amount, code) Task: Retrieve code from orders whose code is found in invoices rows where code matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = ord.code );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02662
train
v2
Schema: transactions (alias: txn)(name, code, id, type) shipments(code, name, amount, value) Task: Retrieve code from transactions that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02663
train
v3
Schema: products (alias: prod)(status, value, level, salary) employees(value, type, amount, id) Task: Find id from products where salary exceeds the average salary from employees for the same id. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02664
train
v3
Schema: customers (alias: cust)(value, type, code, status) schedules(id, value, name, type) Task: Find code from customers where salary exceeds the count of salary from schedules for the same id. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.id = cust.id );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02665
train
v2
Schema: orders (alias: ord)(level, name, amount, type) invoices(date, value, amount, code) Task: Retrieve amount from orders that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02666
train
v3
Schema: customers (alias: cust)(id, type, name, date) shipments(salary, status, date, name) Task: Retrieve code from customers with salary above the SUM(value) of shipments rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.level = cust.level );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02667
train
v2
Schema: requests (alias: ordr)(amount, level, date, name) products(status, code, type, level) Task: Find id from requests where a matching record exists in products with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02668
train
v2
Schema: managers (alias: mgr)(salary, id, status, level) regions(level, status, id, type) Task: Retrieve salary from managers that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02669
train
v3
Schema: shipments (alias: shp)(value, type, name, status) schedules(name, value, type, amount) Task: Find name from shipments where value exceeds the average amount from schedules for the same code. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.code = shp.code );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02670
train
v2
Schema: transactions (alias: txn)(amount, type, level, code) schedules(id, status, type, name) Task: Find value from transactions where a matching record exists in schedules with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = txn.level );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02671
train
v1
Schema: projects (alias: prj)(amount, level, name, code) departments(code, name, date, id) Task: Select amount from projects where status exists in departments for the same status. SQL:
SELECT amount FROM projects AS prj WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02672
train
v2
Schema: sales (alias: sale)(code, amount, level, salary) staff(type, amount, date, id) Task: Find value from sales where a matching record exists in staff with the same id. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "value", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02673
train
v1
Schema: categories (alias: catg)(type, amount, level, date) products(type, name, status, code) Task: Retrieve name from categories whose id is found in products rows where code matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02674
train
v3
Schema: accounts (alias: acct)(amount, date, code, level) schedules(code, salary, id, value) Task: Retrieve amount from accounts with amount above the SUM(amount) of schedules rows sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02675
train
v3
Schema: requests (alias: ordr)(date, type, name, id) shipments(type, date, amount, level) Task: Retrieve value from requests with salary above the MIN(salary) of shipments rows sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02676
train
v1
Schema: items (alias: lne)(status, type, name, amount) products(type, amount, date, value) Task: Retrieve id from items whose level is found in products rows where status matches the outer record. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = lne.status );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02677
train
v1
Schema: employees (alias: emp)(value, code, salary, amount) orders(level, salary, name, type) Task: Find code from employees where type appears in orders entries with matching code. SQL:
SELECT code FROM employees AS emp WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02678
train
v1
Schema: invoices (alias: inv)(date, salary, amount, type) shipments(id, level, status, code) Task: Retrieve name from invoices whose id is found in shipments rows where id matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02679
train
v1
Schema: shipments (alias: shp)(level, type, status, salary) invoices(date, status, code, value) Task: Find code from shipments where status appears in invoices entries with matching level. SQL:
SELECT code FROM shipments AS shp WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = shp.level );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02680
train
v3
Schema: transactions (alias: txn)(amount, date, type, value) requests(type, code, name, status) Task: Find value from transactions where salary exceeds the minimum value from requests for the same type. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02681
train
v2
Schema: categories (alias: catg)(date, name, salary, code) managers(id, type, status, amount) Task: Find amount from categories where a matching record exists in managers with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = catg.status );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02682
train
v3
Schema: invoices (alias: inv)(type, amount, name, code) transactions(level, code, name, date) Task: Retrieve id from invoices with salary above the SUM(salary) of transactions rows sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02683
train
v1
Schema: projects (alias: prj)(code, status, name, level) customers(value, code, status, id) Task: Select value from projects where code exists in customers for the same level. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = prj.level );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02684
train
v3
Schema: accounts (alias: acct)(date, value, status, type) departments(amount, value, id, date) Task: Retrieve value from accounts with value above the MIN(salary) of departments rows sharing the same level. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02685
train
v1
Schema: regions (alias: rgn)(code, value, type, salary) transactions(code, date, id, level) Task: Select amount from regions where code exists in transactions for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = rgn.level );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02686
train
v3
Schema: requests (alias: ordr)(date, type, value, status) accounts(level, name, type, status) Task: Retrieve name from requests with value above the SUM(amount) of accounts rows sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02687
train
v1
Schema: orders (alias: ord)(name, date, status, value) requests(code, status, level, type) Task: Find value from orders where code appears in requests entries with matching code. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02688
train
v2
Schema: departments (alias: dept)(type, amount, value, code) customers(id, salary, code, value) Task: Retrieve amount from departments that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = dept.code );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02689
train
v1
Schema: regions (alias: rgn)(salary, id, value, code) invoices(date, amount, name, level) Task: Select id from regions where type exists in invoices for the same status. SQL:
SELECT id FROM regions AS rgn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02690
train
v2
Schema: products (alias: prod)(level, amount, status, name) customers(level, name, amount, status) Task: Retrieve id from products that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = prod.type );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02691
train
v2
Schema: orders (alias: ord)(date, id, amount, type) accounts(level, code, status, name) Task: Find value from orders where a matching record exists in accounts with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02692
train
v2
Schema: branches (alias: brc)(code, name, date, value) products(status, value, date, salary) Task: Find salary from branches where a matching record exists in products with the same status. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = brc.status );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02693
train
v1
Schema: transactions (alias: txn)(level, date, code, salary) accounts(type, level, status, date) Task: Retrieve amount from transactions whose level is found in accounts rows where id matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02694
train
v3
Schema: departments (alias: dept)(salary, code, date, status) staff(id, amount, level, name) Task: Find id from departments where value exceeds the average value from staff for the same level. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.level = dept.level );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02695
train
v1
Schema: categories (alias: catg)(name, value, status, type) invoices(level, amount, value, salary) Task: Retrieve value from categories whose id is found in invoices rows where type matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02696
train
v2
Schema: shipments (alias: shp)(status, date, salary, code) employees(salary, level, amount, value) Task: Find value from shipments where a matching record exists in employees with the same code. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = shp.code );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02697
train
v3
Schema: categories (alias: catg)(code, name, value, level) requests(type, name, salary, date) Task: Retrieve id from categories with amount above the AVG(salary) of requests rows sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02698
train
v2
Schema: staff (alias: empl)(status, value, code, name) products(salary, level, name, type) Task: Find salary from staff where a matching record exists in products with the same level. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "salary", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02699
train