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: customers (alias: cust)(salary, level, type, name) categories(type, id, code, date) Task: Find amount from customers where a matching record exists in categories with the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = cust.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13800
train
v1
Schema: items (alias: lne)(value, name, id, amount) orders(salary, code, date, id) Task: Retrieve salary from items whose code is found in orders rows where id matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13801
train
v2
Schema: items (alias: lne)(amount, salary, status, id) schedules(status, value, amount, name) Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13802
train
v1
Schema: accounts (alias: acct)(id, type, level, name) transactions(code, type, value, salary) Task: Select code from accounts where id exists in transactions for the same code. SQL:
SELECT code FROM accounts AS acct WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13803
train
v2
Schema: staff (alias: empl)(id, value, level, name) schedules(date, level, status, value) Task: Retrieve value from staff that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13804
train
v3
Schema: managers (alias: mgr)(amount, name, code, level) items(salary, id, value, name) Task: Retrieve id from managers with value above the COUNT(value) of items rows sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.level = mgr.level );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13805
train
v1
Schema: departments (alias: dept)(type, id, name, salary) shipments(value, level, name, amount) Task: Find id from departments where type appears in shipments entries with matching id. SQL:
SELECT id FROM departments AS dept WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13806
train
v3
Schema: staff (alias: empl)(status, level, date, type) transactions(code, id, level, status) Task: Find id from staff where value exceeds the average value from transactions for the same code. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.code = empl.code );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13807
train
v3
Schema: branches (alias: brc)(date, level, id, type) regions(code, id, status, level) Task: Find name from branches where salary exceeds the total value from regions for the same level. SQL:
SELECT name FROM branches AS brc WHERE salary > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.level = brc.level );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13808
train
v3
Schema: employees (alias: emp)(value, salary, amount, code) projects(salary, code, amount, name) Task: Find salary from employees where salary exceeds the minimum amount from projects for the same id. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.id = emp.id );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13809
train
v1
Schema: customers (alias: cust)(amount, name, id, salary) shipments(status, id, date, level) Task: Retrieve salary from customers whose code is found in shipments rows where code matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = cust.code );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13810
train
v1
Schema: departments (alias: dept)(id, name, value, code) staff(id, code, amount, salary) Task: Retrieve name from departments whose type is found in staff rows where level matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = dept.level );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13811
train
v3
Schema: accounts (alias: acct)(code, type, value, status) managers(amount, code, name, status) Task: Find value from accounts where salary exceeds the average salary from managers for the same type. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13812
train
v2
Schema: departments (alias: dept)(value, date, id, code) projects(level, id, amount, name) Task: Find id from departments where a matching record exists in projects with the same id. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = dept.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13813
train
v1
Schema: branches (alias: brc)(date, value, id, type) tasks(amount, name, status, value) Task: Find id from branches where status appears in tasks entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13814
train
v2
Schema: branches (alias: brc)(code, amount, status, type) staff(type, value, salary, name) Task: Retrieve salary from branches that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = brc.status );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13815
train
v1
Schema: items (alias: lne)(value, amount, code, name) categories(status, salary, date, id) Task: Retrieve id from items whose status is found in categories rows where type matches the outer record. SQL:
SELECT id FROM items AS lne WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.type = lne.type );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13816
train
v1
Schema: employees (alias: emp)(value, id, date, name) tasks(salary, amount, code, status) Task: Select salary from employees where id exists in tasks for the same code. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = emp.code );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13817
train
v1
Schema: projects (alias: prj)(name, date, level, code) orders(amount, value, level, date) Task: Find value from projects where code appears in orders entries with matching code. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13818
train
v1
Schema: sales (alias: sale)(type, code, salary, date) tasks(status, name, value, date) Task: Retrieve code from sales whose level is found in tasks rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = sale.code );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13819
train
v1
Schema: tasks (alias: tsk)(type, id, status, amount) staff(code, value, name, id) Task: Retrieve code from tasks whose status is found in staff rows where id matches the outer record. SQL:
SELECT code FROM tasks AS tsk WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13820
train
v1
Schema: transactions (alias: txn)(level, value, name, date) staff(salary, name, value, code) Task: Select code from transactions where level exists in staff for the same code. SQL:
SELECT code FROM transactions AS txn WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = txn.code );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13821
train
v2
Schema: projects (alias: prj)(amount, level, name, id) products(name, salary, type, value) Task: Find value from projects where a matching record exists in products with the same id. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = prj.id );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13822
train
v2
Schema: schedules (alias: schd)(level, id, date, amount) orders(amount, code, date, status) Task: Find name from schedules where a matching record exists in orders with the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13823
train
v2
Schema: invoices (alias: inv)(level, amount, value, code) requests(salary, status, level, value) Task: Retrieve amount from invoices that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13824
train
v1
Schema: transactions (alias: txn)(date, value, type, status) regions(code, amount, name, type) Task: Retrieve salary from transactions whose code is found in regions rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13825
train
v3
Schema: schedules (alias: schd)(id, type, salary, amount) shipments(amount, name, code, salary) Task: Find code from schedules where salary exceeds the average salary from shipments for the same id. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13826
train
v3
Schema: requests (alias: ordr)(code, status, id, salary) shipments(date, salary, value, type) Task: Find value from requests where amount exceeds the maximum salary from shipments for the same code. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13827
train
v1
Schema: sales (alias: sale)(status, salary, amount, level) requests(code, amount, date, level) Task: Retrieve name from sales whose code is found in requests rows where level matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13828
train
v2
Schema: items (alias: lne)(level, date, type, value) branches(level, date, code, type) Task: Find code from items where a matching record exists in branches with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = lne.status );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13829
train
v2
Schema: employees (alias: emp)(status, type, id, code) sales(id, status, date, salary) Task: Retrieve salary from employees that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13830
train
v1
Schema: tasks (alias: tsk)(code, status, salary, level) accounts(status, value, salary, id) Task: Select name from tasks where level exists in accounts for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13831
train
v2
Schema: tasks (alias: tsk)(amount, id, salary, status) staff(name, id, status, level) Task: Retrieve salary from tasks that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13832
train
v3
Schema: schedules (alias: schd)(id, code, status, salary) products(type, name, status, level) Task: Find amount from schedules where value exceeds the minimum amount from products for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13833
train
v1
Schema: staff (alias: empl)(id, name, date, type) categories(type, status, salary, code) Task: Find id from staff where level appears in categories entries with matching id. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = empl.id );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13834
train
v2
Schema: invoices (alias: inv)(level, date, id, code) customers(id, date, name, amount) Task: Retrieve id from invoices that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13835
train
v2
Schema: tasks (alias: tsk)(status, level, code, salary) invoices(salary, date, value, amount) Task: Retrieve name from tasks that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13836
train
v2
Schema: transactions (alias: txn)(name, date, amount, id) items(amount, name, value, date) Task: Retrieve salary from transactions that have at least one corresponding entry in items sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13837
train
v1
Schema: shipments (alias: shp)(value, amount, id, code) products(date, level, value, type) Task: Select salary from shipments where code exists in products for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13838
train
v1
Schema: categories (alias: catg)(value, id, type, status) transactions(type, id, amount, value) Task: Select name from categories where code exists in transactions for the same id. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13839
train
v3
Schema: branches (alias: brc)(amount, value, date, level) staff(level, name, type, date) Task: Find value from branches where value exceeds the average value from staff for the same code. SQL:
SELECT value FROM branches AS brc WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.code = brc.code );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13840
train
v2
Schema: accounts (alias: acct)(code, type, amount, salary) branches(type, id, amount, name) Task: Retrieve salary from accounts that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "salary", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13841
train
v2
Schema: shipments (alias: shp)(id, code, type, salary) schedules(amount, name, date, salary) Task: Find id from shipments where a matching record exists in schedules with the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13842
train
v2
Schema: managers (alias: mgr)(amount, date, code, value) departments(date, type, salary, status) Task: Find name from managers where a matching record exists in departments with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13843
train
v1
Schema: employees (alias: emp)(value, level, type, status) staff(status, amount, level, value) Task: Find name from employees where level appears in staff entries with matching type. SQL:
SELECT name FROM employees AS emp WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = emp.type );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13844
train
v3
Schema: invoices (alias: inv)(amount, salary, status, type) schedules(code, date, id, level) Task: Retrieve salary from invoices with salary above the COUNT(salary) of schedules rows sharing the same code. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13845
train
v1
Schema: transactions (alias: txn)(value, amount, salary, status) sales(level, code, date, name) Task: Retrieve salary from transactions whose status is found in sales rows where id matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13846
train
v2
Schema: customers (alias: cust)(amount, code, value, id) sales(amount, value, salary, date) Task: Retrieve amount from customers that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = cust.status );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13847
train
v2
Schema: customers (alias: cust)(type, status, amount, id) tasks(type, id, status, level) Task: Retrieve code from customers that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = cust.code );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13848
train
v3
Schema: managers (alias: mgr)(amount, code, salary, value) invoices(name, date, status, level) Task: Find amount from managers where salary exceeds the minimum amount from invoices for the same status. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = mgr.status );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13849
train
v1
Schema: invoices (alias: inv)(amount, name, code, id) accounts(type, salary, id, date) Task: Find name from invoices where code appears in accounts entries with matching level. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13850
train
v1
Schema: tasks (alias: tsk)(amount, level, value, type) items(value, name, date, type) Task: Retrieve name from tasks whose code is found in items rows where code matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13851
train
v1
Schema: tasks (alias: tsk)(name, type, status, level) accounts(status, level, date, salary) Task: Select code from tasks where type exists in accounts for the same status. SQL:
SELECT code FROM tasks AS tsk WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13852
train
v3
Schema: departments (alias: dept)(name, type, status, id) items(name, salary, type, status) Task: Find value from departments where salary exceeds the minimum value from items for the same status. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13853
train
v3
Schema: requests (alias: ordr)(status, date, type, id) tasks(amount, name, id, type) Task: Retrieve code from requests with salary above the MAX(value) of tasks rows sharing the same type. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.type = ordr.type );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13854
train
v3
Schema: branches (alias: brc)(amount, level, type, value) staff(value, salary, id, type) Task: Find salary from branches where amount exceeds the total value from staff for the same level. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT SUM(value) FROM staff AS empl WHERE empl.level = brc.level );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13855
train
v2
Schema: regions (alias: rgn)(name, salary, level, date) tasks(date, code, amount, name) Task: Find id from regions where a matching record exists in tasks with the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = rgn.status );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13856
train
v3
Schema: transactions (alias: txn)(name, amount, level, salary) categories(code, name, date, value) Task: Retrieve id from transactions with amount above the SUM(amount) of categories rows sharing the same level. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13857
train
v2
Schema: orders (alias: ord)(amount, date, id, status) tasks(code, date, value, id) Task: Retrieve code from orders that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13858
train
v3
Schema: accounts (alias: acct)(value, amount, status, salary) shipments(date, level, id, name) Task: Find amount from accounts where amount exceeds the total amount from shipments for the same status. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13859
train
v1
Schema: shipments (alias: shp)(amount, level, salary, code) requests(type, id, date, status) Task: Select name from shipments where code exists in requests for the same level. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13860
train
v2
Schema: tasks (alias: tsk)(level, status, name, code) requests(id, type, date, code) Task: Retrieve amount from tasks that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "amount", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13861
train
v3
Schema: categories (alias: catg)(id, amount, type, date) projects(salary, value, status, type) Task: Retrieve value from categories with amount above the COUNT(amount) of projects rows sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.level = catg.level );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13862
train
v1
Schema: items (alias: lne)(status, date, code, type) customers(code, amount, value, type) Task: Retrieve salary from items whose level is found in customers rows where level matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = lne.level );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13863
train
v1
Schema: projects (alias: prj)(salary, type, date, status) categories(salary, amount, type, date) Task: Select value from projects where type exists in categories for the same status. SQL:
SELECT value FROM projects AS prj WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = prj.status );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13864
train
v3
Schema: categories (alias: catg)(name, date, amount, id) customers(value, code, type, date) Task: Find name from categories where salary exceeds the minimum salary from customers for the same id. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.id = catg.id );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13865
train
v2
Schema: items (alias: lne)(amount, type, name, salary) tasks(level, value, code, type) Task: Find id from items where a matching record exists in tasks with the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = lne.type );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13866
train
v2
Schema: transactions (alias: txn)(status, level, type, code) staff(code, value, date, amount) Task: Find salary from transactions where a matching record exists in staff with the same code. SQL:
SELECT salary 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": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13867
train
v2
Schema: categories (alias: catg)(code, level, salary, status) branches(date, amount, id, type) Task: Find code from categories where a matching record exists in branches with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = catg.code );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13868
train
v3
Schema: categories (alias: catg)(code, value, id, status) shipments(type, level, id, date) Task: Retrieve salary from categories with value above the AVG(amount) of shipments rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13869
train
v1
Schema: shipments (alias: shp)(amount, level, date, name) regions(value, id, status, code) Task: Find id from shipments where level appears in regions entries with matching id. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13870
train
v2
Schema: requests (alias: ordr)(value, code, type, amount) sales(id, name, value, amount) Task: Find code from requests where a matching record exists in sales with the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = ordr.type );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13871
train
v3
Schema: transactions (alias: txn)(level, value, id, amount) items(code, level, amount, status) Task: Retrieve name from transactions with amount above the MAX(salary) of items rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MAX(salary) FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13872
train
v3
Schema: schedules (alias: schd)(value, amount, name, type) staff(value, status, salary, level) Task: Retrieve code from schedules with salary above the MAX(amount) of staff rows sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.type = schd.type );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13873
train
v1
Schema: accounts (alias: acct)(id, amount, level, type) customers(code, status, level, date) Task: Retrieve name from accounts whose id is found in customers rows where code matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13874
train
v3
Schema: projects (alias: prj)(value, id, date, status) accounts(code, amount, salary, status) Task: Find salary from projects where value exceeds the minimum amount from accounts for the same status. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.status = prj.status );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13875
train
v2
Schema: departments (alias: dept)(salary, amount, status, date) tasks(salary, id, value, type) Task: Retrieve name from departments that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = dept.type );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13876
train
v3
Schema: managers (alias: mgr)(type, level, amount, value) branches(amount, id, type, code) Task: Find name from managers where value exceeds the minimum salary from branches for the same type. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13877
train
v1
Schema: requests (alias: ordr)(status, value, type, level) categories(amount, salary, value, level) Task: Find salary from requests where type appears in categories entries with matching status. SQL:
SELECT salary FROM requests AS ordr WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13878
train
v3
Schema: orders (alias: ord)(code, date, value, amount) projects(amount, date, level, salary) Task: Find id from orders where salary exceeds the maximum salary from projects for the same status. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.status = ord.status );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13879
train
v1
Schema: projects (alias: prj)(status, date, type, amount) products(status, id, code, date) Task: Select code from projects where status exists in products for the same code. SQL:
SELECT code FROM projects AS prj WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = prj.code );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13880
train
v2
Schema: shipments (alias: shp)(value, level, id, code) invoices(value, level, name, code) Task: Retrieve name from shipments that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = shp.id );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13881
train
v2
Schema: regions (alias: rgn)(salary, level, date, value) tasks(type, code, name, value) Task: Retrieve amount from regions that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = rgn.status );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13882
train
v1
Schema: regions (alias: rgn)(level, code, salary, name) products(id, level, code, date) Task: Retrieve value from regions whose level is found in products rows where level matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13883
train
v2
Schema: projects (alias: prj)(level, amount, status, value) categories(amount, code, value, date) Task: Retrieve salary from projects that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13884
train
v3
Schema: tasks (alias: tsk)(amount, status, name, salary) products(date, name, level, id) Task: Retrieve name from tasks with value above the MIN(amount) of products rows sharing the same status. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13885
train
v2
Schema: requests (alias: ordr)(amount, level, status, code) regions(type, code, id, level) Task: Retrieve salary from requests that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13886
train
v1
Schema: tasks (alias: tsk)(date, amount, value, level) products(status, code, level, value) Task: Find amount from tasks where type appears in products entries with matching status. SQL:
SELECT amount FROM tasks AS tsk WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13887
train
v3
Schema: customers (alias: cust)(level, id, value, amount) invoices(amount, salary, value, code) Task: Retrieve value from customers with value above the MAX(value) of invoices rows sharing the same status. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13888
train
v3
Schema: accounts (alias: acct)(name, salary, id, amount) branches(date, value, id, type) Task: Retrieve name from accounts with salary above the COUNT(amount) of branches rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13889
train
v1
Schema: managers (alias: mgr)(id, level, salary, type) staff(value, code, amount, salary) Task: Find code from managers where id appears in staff entries with matching code. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13890
train
v2
Schema: orders (alias: ord)(name, id, value, date) sales(level, type, date, id) Task: Find salary from orders where a matching record exists in sales with the same type. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13891
train
v1
Schema: requests (alias: ordr)(name, code, salary, date) managers(salary, date, type, value) Task: Find salary from requests where type appears in managers entries with matching level. SQL:
SELECT salary FROM requests AS ordr WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13892
train
v1
Schema: shipments (alias: shp)(amount, date, id, code) managers(level, code, id, status) Task: Select amount from shipments where code exists in managers for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13893
train
v2
Schema: transactions (alias: txn)(date, code, amount, status) regions(level, amount, code, type) Task: Retrieve value from transactions that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13894
train
v3
Schema: sales (alias: sale)(date, amount, value, type) items(name, code, value, type) Task: Retrieve id from sales with salary above the COUNT(amount) of items rows sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13895
train
v3
Schema: employees (alias: emp)(date, name, code, type) items(date, name, status, type) Task: Find id from employees where value exceeds the maximum salary from items for the same code. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM items AS lne WHERE lne.code = emp.code );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13896
train
v3
Schema: accounts (alias: acct)(type, level, value, date) customers(date, value, id, code) Task: Retrieve value from accounts with salary above the MAX(amount) of customers rows sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13897
train
v3
Schema: tasks (alias: tsk)(name, salary, id, date) departments(level, name, amount, value) Task: Find name from tasks where salary exceeds the minimum salary from departments for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13898
train
v1
Schema: transactions (alias: txn)(date, code, value, status) invoices(salary, type, value, status) Task: Retrieve code from transactions whose code is found in invoices rows where code matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13899
train