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
v2
Schema: categories (alias: catg)(salary, status, type, value) invoices(value, date, level, id) Task: Retrieve code from categories that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12500
train
v2
Schema: sales (alias: sale)(code, value, id, type) invoices(name, id, value, type) Task: Find value from sales where a matching record exists in invoices with the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12501
train
v3
Schema: categories (alias: catg)(status, level, salary, code) branches(date, value, id, type) Task: Retrieve name from categories with salary above the MAX(value) of branches rows sharing the same id. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MAX(value) FROM branches AS brc WHERE brc.id = catg.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12502
train
v2
Schema: transactions (alias: txn)(code, name, status, type) sales(date, level, id, code) Task: Retrieve value from transactions that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12503
train
v1
Schema: projects (alias: prj)(value, code, status, amount) customers(amount, status, id, date) Task: Retrieve id from projects whose level is found in customers rows where code matches the outer record. SQL:
SELECT id FROM projects AS prj WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = prj.code );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12504
train
v1
Schema: transactions (alias: txn)(name, status, code, date) invoices(code, date, id, type) Task: Select id from transactions where type exists in invoices for the same status. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12505
train
v3
Schema: requests (alias: ordr)(code, level, status, value) tasks(date, salary, level, id) Task: Retrieve value from requests with value above the MAX(value) of tasks rows sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.id = ordr.id );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "value", "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_12506
train
v1
Schema: schedules (alias: schd)(status, amount, id, type) regions(date, type, amount, level) Task: Retrieve salary from schedules whose code is found in regions rows where status matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12507
train
v2
Schema: requests (alias: ordr)(level, salary, code, status) products(type, id, level, amount) Task: Retrieve id from requests that have at least one corresponding entry in products sharing 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_12508
train
v1
Schema: products (alias: prod)(id, level, date, type) tasks(code, salary, value, status) Task: Select value from products where type exists in tasks for the same code. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = prod.code );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12509
train
v3
Schema: staff (alias: empl)(code, type, id, salary) schedules(amount, value, code, status) Task: Find value from staff where amount exceeds the average value from schedules for the same level. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.level = empl.level );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12510
train
v2
Schema: schedules (alias: schd)(id, level, date, amount) transactions(amount, id, date, level) Task: Retrieve salary from schedules that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12511
train
v3
Schema: branches (alias: brc)(date, amount, level, status) categories(id, level, status, date) Task: Find salary from branches where salary exceeds the average amount from categories for the same code. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.code = brc.code );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12512
train
v1
Schema: sales (alias: sale)(value, type, amount, date) orders(salary, code, name, value) Task: Select salary from sales where type exists in orders for the same status. SQL:
SELECT salary FROM sales AS sale WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12513
train
v1
Schema: projects (alias: prj)(amount, status, level, type) categories(code, level, type, status) Task: Select value from projects where type exists in categories for the same level. SQL:
SELECT value FROM projects AS prj WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = prj.level );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12514
train
v2
Schema: transactions (alias: txn)(code, date, level, value) managers(salary, name, amount, code) Task: Find amount from transactions where a matching record exists in managers with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12515
train
v1
Schema: branches (alias: brc)(amount, code, type, name) managers(value, id, status, salary) Task: Select id from branches where level exists in managers for the same level. SQL:
SELECT id FROM branches AS brc WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = brc.level );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12516
train
v1
Schema: projects (alias: prj)(salary, type, value, amount) orders(level, code, type, value) Task: Retrieve name from projects whose id is found in orders rows where code matches the outer record. SQL:
SELECT name FROM projects AS prj WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12517
train
v1
Schema: transactions (alias: txn)(value, name, salary, amount) orders(level, code, value, id) Task: Select amount from transactions where level exists in orders for the same id. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12518
train
v2
Schema: categories (alias: catg)(status, salary, date, id) products(id, amount, status, value) Task: Find amount from categories where a matching record exists in products with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12519
train
v2
Schema: projects (alias: prj)(value, id, level, type) orders(type, date, id, amount) Task: Retrieve code from projects that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12520
train
v1
Schema: schedules (alias: schd)(date, value, name, type) branches(status, value, code, date) Task: Find id from schedules where status appears in branches entries with matching type. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12521
train
v3
Schema: items (alias: lne)(id, status, code, level) transactions(status, date, code, value) Task: Find amount from items where value exceeds the total amount from transactions for the same code. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.code = lne.code );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12522
train
v1
Schema: products (alias: prod)(id, code, amount, type) requests(amount, value, date, name) Task: Retrieve amount from products whose status is found in requests rows where level matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = prod.level );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12523
train
v1
Schema: departments (alias: dept)(salary, status, level, name) projects(level, name, id, status) Task: Select salary from departments where level exists in projects for the same code. SQL:
SELECT salary FROM departments AS dept WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.code = dept.code );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12524
train
v3
Schema: schedules (alias: schd)(salary, date, code, id) invoices(id, code, status, date) Task: Retrieve value from schedules with value above the MIN(amount) of invoices rows sharing the same status. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12525
train
v3
Schema: sales (alias: sale)(id, code, salary, level) managers(amount, name, salary, level) Task: Find id from sales where value exceeds the maximum value from managers for the same id. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.id = sale.id );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12526
train
v1
Schema: orders (alias: ord)(amount, status, code, name) accounts(date, id, level, value) Task: Find salary from orders where code appears in accounts entries with matching id. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12527
train
v1
Schema: departments (alias: dept)(id, value, salary, date) transactions(type, salary, value, amount) Task: Find value from departments where level appears in transactions entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12528
train
v3
Schema: managers (alias: mgr)(level, status, salary, date) orders(status, name, date, code) Task: Find salary from managers where amount exceeds the count of value from orders for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12529
train
v3
Schema: branches (alias: brc)(status, id, amount, level) staff(level, date, amount, type) Task: Find code from branches where amount exceeds the maximum value from staff for the same level. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT MAX(value) FROM staff AS empl WHERE empl.level = brc.level );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12530
train
v3
Schema: tasks (alias: tsk)(value, code, level, id) regions(date, salary, id, name) Task: Find id from tasks where amount exceeds the count of salary from regions for the same code. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12531
train
v2
Schema: tasks (alias: tsk)(amount, salary, date, id) categories(value, name, type, level) Task: Retrieve name from tasks that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12532
train
v2
Schema: branches (alias: brc)(date, amount, type, code) orders(status, level, value, code) Task: Retrieve salary from branches that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = brc.code );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "salary", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12533
train
v3
Schema: accounts (alias: acct)(value, id, name, level) managers(name, level, type, id) Task: Retrieve id from accounts with salary above the MAX(value) of managers rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12534
train
v3
Schema: shipments (alias: shp)(code, amount, date, salary) employees(code, value, level, id) Task: Retrieve salary from shipments with salary above the MAX(amount) of employees rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12535
train
v2
Schema: regions (alias: rgn)(date, salary, id, name) customers(salary, status, date, name) Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT amount 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": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12536
train
v2
Schema: invoices (alias: inv)(salary, date, name, level) items(status, type, level, date) Task: Find value from invoices where a matching record exists in items with the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12537
train
v2
Schema: requests (alias: ordr)(salary, id, name, amount) schedules(date, salary, value, status) Task: Retrieve amount from requests that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = ordr.type );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12538
train
v2
Schema: schedules (alias: schd)(amount, id, status, value) staff(amount, id, value, status) Task: Retrieve id from schedules that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12539
train
v1
Schema: items (alias: lne)(value, status, amount, type) employees(code, id, date, name) Task: Retrieve value from items whose code is found in employees rows where type matches the outer record. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12540
train
v3
Schema: products (alias: prod)(date, level, name, amount) staff(status, id, amount, salary) Task: Find code from products where value exceeds the minimum value from staff for the same code. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT MIN(value) FROM staff AS empl WHERE empl.code = prod.code );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12541
train
v2
Schema: transactions (alias: txn)(id, name, status, salary) accounts(level, value, date, code) Task: Retrieve code from transactions that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12542
train
v1
Schema: staff (alias: empl)(id, salary, name, value) orders(type, name, code, id) Task: Find id from staff where status appears in orders entries with matching id. SQL:
SELECT id FROM staff AS empl WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12543
train
v3
Schema: orders (alias: ord)(name, salary, status, id) customers(name, type, amount, status) Task: Find value from orders where amount exceeds the average value from customers for the same id. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12544
train
v2
Schema: sales (alias: sale)(value, level, status, amount) departments(amount, value, name, status) Task: Retrieve value from sales that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = sale.level );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12545
train
v2
Schema: employees (alias: emp)(salary, type, amount, level) branches(id, date, value, amount) Task: Retrieve value from employees that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = emp.code );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "value", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12546
train
v2
Schema: customers (alias: cust)(value, name, id, salary) requests(salary, date, amount, type) Task: Retrieve value from customers that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12547
train
v2
Schema: orders (alias: ord)(value, level, salary, status) transactions(value, level, id, amount) Task: Find id from orders where a matching record exists in transactions with the same id. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12548
train
v3
Schema: tasks (alias: tsk)(salary, status, type, code) customers(amount, id, name, date) Task: Retrieve amount from tasks with salary above the MAX(value) of customers rows sharing the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12549
train
v1
Schema: invoices (alias: inv)(type, id, name, status) customers(amount, value, type, salary) Task: Select value from invoices where code exists in customers for the same code. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12550
train
v3
Schema: orders (alias: ord)(name, id, value, level) categories(amount, value, level, name) Task: Retrieve amount from orders with amount above the SUM(value) of categories rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12551
train
v3
Schema: schedules (alias: schd)(name, id, date, amount) items(salary, type, code, amount) Task: Retrieve amount from schedules with value above the AVG(amount) of items rows sharing the same code. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT AVG(amount) FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12552
train
v1
Schema: orders (alias: ord)(status, type, level, value) invoices(name, amount, status, code) Task: Retrieve code from orders whose level is found in invoices rows where id matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12553
train
v1
Schema: products (alias: prod)(value, name, amount, salary) projects(value, salary, id, code) Task: Find code from products where status appears in projects entries with matching code. SQL:
SELECT code FROM products AS prod WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.code = prod.code );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12554
train
v3
Schema: tasks (alias: tsk)(salary, code, amount, type) shipments(amount, date, value, name) Task: Find code from tasks where salary exceeds the count of value from shipments for the same level. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12555
train
v1
Schema: customers (alias: cust)(level, date, code, status) managers(amount, type, status, code) Task: Find value from customers where status appears in managers entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12556
train
v1
Schema: customers (alias: cust)(date, level, name, salary) departments(id, level, value, salary) Task: Find id from customers where status appears in departments entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = cust.type );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12557
train
v3
Schema: branches (alias: brc)(name, level, id, status) customers(level, date, amount, name) Task: Find value from branches where salary exceeds the average salary from customers for the same status. SQL:
SELECT value FROM branches AS brc WHERE salary > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.status = brc.status );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12558
train
v3
Schema: products (alias: prod)(level, type, salary, amount) employees(id, level, code, date) Task: Retrieve value from products with amount above the MAX(salary) of employees rows sharing the same status. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12559
train
v1
Schema: items (alias: lne)(date, amount, name, code) sales(date, salary, code, name) Task: Select value from items where id exists in sales for the same id. SQL:
SELECT value FROM items AS lne WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = lne.id );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12560
train
v3
Schema: transactions (alias: txn)(date, id, level, status) managers(id, status, amount, date) Task: Retrieve amount from transactions with amount above the AVG(amount) of managers rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12561
train
v3
Schema: regions (alias: rgn)(type, date, level, salary) staff(amount, level, value, type) Task: Find name from regions where value exceeds the minimum value from staff for the same id. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MIN(value) FROM staff AS empl WHERE empl.id = rgn.id );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12562
train
v3
Schema: customers (alias: cust)(code, id, level, amount) schedules(name, amount, level, salary) Task: Retrieve name from customers with salary above the MIN(salary) of schedules rows sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.code = cust.code );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12563
train
v2
Schema: accounts (alias: acct)(type, name, salary, code) transactions(type, value, name, amount) Task: Find value from accounts where a matching record exists in transactions with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12564
train
v3
Schema: products (alias: prod)(type, code, id, salary) shipments(date, id, salary, code) Task: Find salary from products where value exceeds the maximum value from shipments for the same code. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.code = prod.code );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12565
train
v1
Schema: products (alias: prod)(date, level, status, id) sales(status, salary, value, date) Task: Select id from products where level exists in sales for the same code. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12566
train
v1
Schema: sales (alias: sale)(type, level, name, amount) products(date, type, status, code) Task: Select code from sales where type exists in products for the same type. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12567
train
v3
Schema: categories (alias: catg)(date, status, salary, value) accounts(status, amount, type, salary) Task: Retrieve amount from categories with salary above the AVG(value) of accounts rows sharing the same level. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12568
train
v3
Schema: employees (alias: emp)(value, name, salary, id) shipments(salary, status, id, code) Task: Retrieve id from employees with amount above the AVG(amount) of shipments rows sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12569
train
v2
Schema: employees (alias: emp)(salary, amount, name, status) staff(amount, status, level, date) Task: Retrieve value from employees that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12570
train
v1
Schema: regions (alias: rgn)(name, date, id, level) categories(value, id, level, code) Task: Find id from regions where type appears in categories entries with matching level. SQL:
SELECT id FROM regions AS rgn WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12571
train
v2
Schema: sales (alias: sale)(level, value, date, type) regions(name, amount, salary, date) Task: Retrieve salary from sales that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12572
train
v3
Schema: departments (alias: dept)(salary, type, id, level) items(name, id, value, date) Task: Retrieve name from departments with amount above the COUNT(amount) of items rows sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12573
train
v2
Schema: accounts (alias: acct)(amount, status, name, code) transactions(salary, date, type, amount) Task: Retrieve salary from accounts that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12574
train
v2
Schema: managers (alias: mgr)(name, type, amount, date) sales(name, amount, salary, id) Task: Find name from managers where a matching record exists in sales with the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = mgr.type );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12575
train
v3
Schema: schedules (alias: schd)(value, code, level, status) accounts(value, level, id, amount) Task: Retrieve code from schedules with amount above the SUM(salary) of accounts rows sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12576
train
v1
Schema: staff (alias: empl)(code, amount, salary, value) schedules(value, id, name, salary) Task: Retrieve name from staff whose status is found in schedules rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12577
train
v1
Schema: sales (alias: sale)(status, value, date, name) orders(status, id, name, date) Task: Retrieve value from sales whose type is found in orders rows where level matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12578
train
v1
Schema: tasks (alias: tsk)(id, name, code, value) employees(date, value, id, amount) Task: Select code from tasks where status exists in employees for the same status. SQL:
SELECT code FROM tasks AS tsk WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12579
train
v2
Schema: requests (alias: ordr)(type, level, salary, code) items(status, code, type, date) Task: Find salary from requests where a matching record exists in items with the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = ordr.level );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12580
train
v2
Schema: products (alias: prod)(code, status, level, name) sales(type, id, code, value) Task: Find id from products where a matching record exists in sales with the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12581
train
v3
Schema: invoices (alias: inv)(amount, value, status, salary) schedules(salary, amount, level, id) Task: Retrieve amount from invoices with salary above the AVG(salary) of schedules rows sharing the same id. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.id = inv.id );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12582
train
v3
Schema: projects (alias: prj)(level, date, salary, status) shipments(name, amount, status, id) Task: Retrieve amount from projects with salary above the MAX(value) of shipments rows sharing the same status. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.status = prj.status );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12583
train
v3
Schema: accounts (alias: acct)(status, type, salary, id) items(value, status, level, id) Task: Retrieve amount from accounts with salary above the COUNT(salary) of items rows sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12584
train
v2
Schema: customers (alias: cust)(type, status, id, salary) schedules(amount, id, value, type) 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_12585
train
v1
Schema: schedules (alias: schd)(type, value, level, status) orders(type, code, id, salary) Task: Find value from schedules where code appears in orders entries with matching id. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12586
train
v2
Schema: customers (alias: cust)(amount, code, type, value) requests(status, code, type, id) Task: Retrieve amount from customers that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12587
train
v1
Schema: branches (alias: brc)(value, status, salary, id) schedules(date, type, code, value) Task: Find id from branches where type appears in schedules entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12588
train
v1
Schema: categories (alias: catg)(name, type, salary, status) tasks(type, id, salary, name) Task: Find id from categories where level appears in tasks entries with matching code. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12589
train
v1
Schema: employees (alias: emp)(level, status, value, salary) branches(value, id, status, salary) Task: Select id from employees where level exists in branches for the same level. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12590
train
v3
Schema: invoices (alias: inv)(date, code, status, type) tasks(salary, amount, status, level) Task: Retrieve name from invoices with amount above the SUM(amount) of tasks rows sharing the same code. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.code = inv.code );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12591
train
v2
Schema: staff (alias: empl)(level, salary, status, value) shipments(id, date, status, level) Task: Find name from staff where a matching record exists in shipments with the same status. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12592
train
v1
Schema: branches (alias: brc)(type, status, amount, value) categories(salary, amount, code, type) Task: Retrieve value from branches whose id is found in categories rows where status matches the outer record. SQL:
SELECT value FROM branches AS brc WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = brc.status );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12593
train
v1
Schema: branches (alias: brc)(amount, level, name, code) sales(name, status, type, date) Task: Find amount from branches where level appears in sales entries with matching code. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = brc.code );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12594
train
v3
Schema: schedules (alias: schd)(amount, name, level, type) projects(type, level, code, date) Task: Find value from schedules where value exceeds the average salary from projects for the same type. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.type = schd.type );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12595
train
v2
Schema: shipments (alias: shp)(status, name, salary, value) orders(code, status, id, salary) Task: Retrieve id from shipments that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12596
train
v2
Schema: customers (alias: cust)(id, level, salary, name) sales(id, amount, salary, name) Task: Find id from customers where a matching record exists in sales with the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = cust.code );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12597
train
v1
Schema: invoices (alias: inv)(date, name, amount, status) staff(name, id, code, status) Task: Retrieve amount from invoices whose level is found in staff rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.id = inv.id );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12598
train
v3
Schema: requests (alias: ordr)(name, code, salary, value) customers(date, name, value, status) Task: Find name from requests where amount exceeds the total salary from customers for the same status. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12599
train