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: requests (alias: ordr)(amount, id, date, level) orders(date, level, type, id) Task: Find amount from requests where a matching record exists in orders with the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17900
train
v3
Schema: sales (alias: sale)(status, id, code, name) accounts(type, level, id, value) Task: Find code from sales where value exceeds the maximum value from accounts for the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17901
train
v3
Schema: managers (alias: mgr)(code, name, level, type) tasks(name, code, salary, amount) Task: Find salary from managers where amount exceeds the maximum value from tasks for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17902
train
v3
Schema: projects (alias: prj)(salary, id, amount, level) branches(name, value, date, salary) Task: Find amount from projects where value exceeds the count of salary from branches for the same level. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17903
train
v3
Schema: branches (alias: brc)(salary, status, name, type) items(id, level, date, code) Task: Retrieve value from branches with amount above the COUNT(value) of items rows sharing the same status. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT COUNT(value) FROM items AS lne WHERE lne.status = brc.status );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17904
train
v3
Schema: managers (alias: mgr)(code, date, level, status) customers(code, salary, date, type) Task: Retrieve amount from managers with amount above the AVG(salary) of customers rows sharing the same type. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17905
train
v2
Schema: categories (alias: catg)(salary, name, date, amount) items(type, code, level, amount) Task: Find salary from categories where a matching record exists in items with the same level. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17906
train
v2
Schema: departments (alias: dept)(date, value, salary, name) shipments(date, code, name, id) Task: Retrieve value from departments that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17907
train
v1
Schema: sales (alias: sale)(level, code, value, date) accounts(amount, status, id, salary) Task: Select value from sales where level exists in accounts for the same level. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17908
train
v1
Schema: projects (alias: prj)(level, value, amount, status) regions(value, salary, amount, status) Task: Retrieve value from projects whose type is found in regions rows where level matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17909
train
v1
Schema: shipments (alias: shp)(name, type, salary, code) managers(salary, id, name, code) Task: Retrieve value from shipments whose level is found in managers rows where code matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17910
train
v2
Schema: requests (alias: ordr)(level, value, code, status) transactions(level, date, amount, type) Task: Retrieve code from requests that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17911
train
v2
Schema: projects (alias: prj)(amount, name, status, date) requests(salary, code, status, value) Task: Find id from projects where a matching record exists in requests with the same id. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = prj.id );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17912
train
v1
Schema: staff (alias: empl)(value, amount, status, type) projects(status, level, amount, name) Task: Select amount from staff where level exists in projects for the same status. SQL:
SELECT amount FROM staff AS empl WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17913
train
v1
Schema: sales (alias: sale)(amount, status, type, date) branches(name, id, salary, level) Task: Retrieve name from sales whose code is found in branches rows where code matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = sale.code );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17914
train
v3
Schema: transactions (alias: txn)(type, value, code, name) customers(status, code, salary, type) Task: Retrieve amount from transactions with value above the COUNT(amount) of customers rows sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.type = txn.type );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17915
train
v3
Schema: invoices (alias: inv)(status, name, level, date) regions(amount, value, level, salary) Task: Find value from invoices where value exceeds the minimum amount from regions for the same status. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17916
train
v3
Schema: shipments (alias: shp)(amount, level, id, value) projects(type, level, code, salary) Task: Retrieve name from shipments with salary above the COUNT(salary) of projects rows sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.type = shp.type );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17917
train
v1
Schema: products (alias: prod)(name, status, id, value) schedules(value, amount, code, level) Task: Select id from products where status exists in schedules for the same level. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17918
train
v3
Schema: invoices (alias: inv)(salary, value, status, amount) products(name, id, type, level) Task: Find code from invoices where amount exceeds the total value from products for the same code. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT SUM(value) FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17919
train
v3
Schema: transactions (alias: txn)(id, type, level, code) orders(code, type, status, level) Task: Find salary from transactions where value exceeds the count of salary from orders for the same id. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17920
train
v3
Schema: schedules (alias: schd)(date, salary, status, id) sales(type, level, name, salary) Task: Retrieve amount from schedules with salary above the SUM(value) of sales rows sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT SUM(value) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17921
train
v2
Schema: tasks (alias: tsk)(type, status, salary, id) managers(level, name, date, type) Task: Find amount from tasks where a matching record exists in managers with the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17922
train
v2
Schema: regions (alias: rgn)(type, level, amount, date) orders(code, level, name, date) Task: Retrieve id from regions that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17923
train
v2
Schema: products (alias: prod)(name, salary, date, value) branches(amount, code, salary, status) Task: Find name from products where a matching record exists in branches with the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = prod.id );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17924
train
v2
Schema: branches (alias: brc)(date, salary, id, code) tasks(amount, type, level, date) Task: Find code from branches where a matching record exists in tasks with the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17925
train
v2
Schema: staff (alias: empl)(salary, code, status, date) categories(type, date, status, salary) Task: Retrieve value from staff that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = empl.id );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17926
train
v1
Schema: projects (alias: prj)(level, salary, date, status) transactions(status, level, value, id) Task: Retrieve amount from projects whose code is found in transactions rows where status matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = prj.status );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17927
train
v3
Schema: regions (alias: rgn)(status, type, code, id) orders(id, date, code, status) Task: Find code from regions where amount exceeds the minimum amount from orders for the same status. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17928
train
v2
Schema: departments (alias: dept)(date, type, id, amount) sales(name, status, amount, date) Task: Retrieve amount from departments that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = dept.id );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17929
train
v1
Schema: schedules (alias: schd)(id, type, date, status) requests(salary, amount, value, code) Task: Find value from schedules where id appears in requests entries with matching code. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17930
train
v1
Schema: managers (alias: mgr)(id, salary, amount, name) requests(level, name, salary, type) Task: Retrieve id from managers whose status is found in requests rows where type matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17931
train
v1
Schema: invoices (alias: inv)(status, salary, amount, value) items(level, code, type, status) Task: Select code from invoices where status exists in items for the same id. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17932
train
v3
Schema: orders (alias: ord)(amount, level, name, salary) staff(level, amount, value, salary) Task: Find code from orders where value exceeds the maximum value from staff for the same code. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17933
train
v2
Schema: transactions (alias: txn)(amount, salary, name, status) sales(status, date, type, level) Task: Retrieve amount from transactions that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17934
train
v3
Schema: items (alias: lne)(amount, value, name, date) regions(type, salary, status, name) Task: Retrieve amount from items with salary above the MIN(amount) of regions rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17935
train
v3
Schema: orders (alias: ord)(type, status, salary, value) schedules(status, salary, date, code) Task: Find salary from orders where value exceeds the maximum value from schedules for the same code. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17936
train
v1
Schema: customers (alias: cust)(name, date, type, salary) projects(date, amount, level, type) Task: Select id from customers where code exists in projects for the same status. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.status = cust.status );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17937
train
v1
Schema: employees (alias: emp)(name, salary, level, value) tasks(status, level, type, salary) Task: Select name from employees where id exists in tasks for the same id. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = emp.id );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17938
train
v3
Schema: branches (alias: brc)(code, name, type, level) products(name, type, salary, amount) Task: Retrieve value from branches with amount above the MIN(value) of products rows sharing the same type. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.type = brc.type );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17939
train
v2
Schema: branches (alias: brc)(value, level, date, id) departments(salary, amount, status, code) Task: Find salary from branches where a matching record exists in departments with the same level. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = brc.level );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "salary", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17940
train
v2
Schema: tasks (alias: tsk)(value, salary, name, amount) items(code, salary, value, level) Task: Find name from tasks where a matching record exists in items with the same type. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17941
train
v1
Schema: sales (alias: sale)(id, status, level, name) shipments(code, id, salary, type) Task: Retrieve amount from sales whose status is found in shipments rows where status matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17942
train
v1
Schema: customers (alias: cust)(type, name, date, id) departments(type, salary, id, value) Task: Find id from customers where code appears in departments entries with matching id. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = cust.id );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17943
train
v3
Schema: schedules (alias: schd)(value, date, status, salary) staff(level, type, amount, name) Task: Retrieve value from schedules with salary above the SUM(amount) of staff rows sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.code = schd.code );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17944
train
v1
Schema: sales (alias: sale)(code, value, type, level) invoices(name, code, amount, date) Task: Select name from sales where id exists in invoices for the same status. SQL:
SELECT name FROM sales AS sale WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = sale.status );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17945
train
v3
Schema: employees (alias: emp)(level, amount, id, date) products(type, id, name, amount) Task: Retrieve code from employees with value above the MIN(salary) of products rows sharing the same status. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM products AS prod WHERE prod.status = emp.status );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17946
train
v2
Schema: projects (alias: prj)(amount, code, status, type) products(date, level, type, salary) Task: Find id from projects where a matching record exists in products with the same code. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = prj.code );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17947
train
v3
Schema: departments (alias: dept)(id, level, amount, name) customers(level, value, name, code) Task: Find amount from departments where amount exceeds the minimum value from customers for the same status. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT MIN(value) FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17948
train
v2
Schema: sales (alias: sale)(code, salary, status, type) departments(type, date, amount, value) Task: Retrieve value from sales that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17949
train
v3
Schema: managers (alias: mgr)(type, date, code, salary) transactions(status, name, level, date) Task: Retrieve id from managers with salary above the COUNT(value) of transactions rows sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17950
train
v2
Schema: regions (alias: rgn)(id, date, level, status) categories(amount, level, id, date) Task: Retrieve code from regions that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17951
train
v3
Schema: branches (alias: brc)(value, amount, name, level) transactions(code, amount, level, date) Task: Find salary from branches where amount exceeds the maximum amount from transactions for the same status. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.status = brc.status );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17952
train
v3
Schema: managers (alias: mgr)(status, level, id, salary) regions(type, date, status, level) Task: Retrieve value from managers with amount above the MIN(salary) of regions rows sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17953
train
v2
Schema: departments (alias: dept)(type, salary, id, amount) items(level, id, date, salary) Task: Retrieve code from departments that have at least one corresponding entry in items sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17954
train
v2
Schema: requests (alias: ordr)(name, date, code, value) employees(status, level, salary, date) Task: Retrieve code from requests that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17955
train
v1
Schema: products (alias: prod)(code, date, name, value) orders(level, salary, name, date) Task: Find salary from products where code appears in orders entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17956
train
v1
Schema: departments (alias: dept)(value, status, level, date) transactions(type, level, date, status) Task: Select value from departments where id exists in transactions for the same code. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = dept.code );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17957
train
v1
Schema: categories (alias: catg)(date, status, name, code) products(amount, value, level, name) Task: Retrieve amount from categories whose type is found in products rows where status matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17958
train
v2
Schema: shipments (alias: shp)(salary, name, date, amount) projects(date, id, salary, value) Task: Retrieve value from shipments that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = shp.status );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "value", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17959
train
v1
Schema: regions (alias: rgn)(type, value, code, status) transactions(date, id, name, code) Task: Retrieve salary from regions whose status is found in transactions rows where type matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = rgn.type );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17960
train
v2
Schema: tasks (alias: tsk)(salary, id, name, value) staff(code, salary, type, status) Task: Retrieve amount from tasks that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17961
train
v1
Schema: shipments (alias: shp)(value, status, name, type) requests(type, status, name, salary) Task: Select id from shipments where id exists in requests for the same level. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17962
train
v3
Schema: invoices (alias: inv)(value, name, status, amount) departments(status, type, name, amount) Task: Retrieve code from invoices with salary above the COUNT(value) of departments rows sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17963
train
v2
Schema: projects (alias: prj)(name, code, level, salary) customers(name, type, amount, code) Task: Find id from projects where a matching record exists in customers with the same id. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = prj.id );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17964
train
v1
Schema: regions (alias: rgn)(status, date, value, salary) orders(name, status, value, salary) Task: Find salary from regions where type appears in orders entries with matching id. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17965
train
v1
Schema: projects (alias: prj)(level, name, date, amount) requests(id, name, salary, type) Task: Find name from projects where level appears in requests entries with matching id. SQL:
SELECT name FROM projects AS prj WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = prj.id );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17966
train
v1
Schema: orders (alias: ord)(value, level, date, amount) shipments(salary, code, value, type) Task: Find salary from orders where id appears in shipments entries with matching id. SQL:
SELECT salary FROM orders AS ord WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17967
train
v1
Schema: branches (alias: brc)(salary, name, date, amount) requests(type, level, date, value) Task: Find amount from branches where level appears in requests entries with matching status. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = brc.status );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17968
train
v1
Schema: transactions (alias: txn)(status, salary, id, type) shipments(status, id, value, name) Task: Select value from transactions where type exists in shipments for the same level. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17969
train
v2
Schema: orders (alias: ord)(id, code, salary, status) accounts(salary, status, date, amount) Task: Retrieve name from orders that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = ord.status );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17970
train
v3
Schema: regions (alias: rgn)(id, status, type, code) orders(type, code, status, name) Task: Retrieve code from regions with amount above the MAX(amount) of orders rows sharing the same level. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17971
train
v1
Schema: managers (alias: mgr)(salary, date, level, code) projects(status, salary, code, value) Task: Select value from managers where type exists in projects for the same id. SQL:
SELECT value FROM managers AS mgr WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = mgr.id );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17972
train
v3
Schema: projects (alias: prj)(amount, name, type, value) transactions(id, name, level, date) Task: Find salary from projects where value exceeds the maximum amount from transactions for the same level. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17973
train
v1
Schema: shipments (alias: shp)(amount, status, date, code) invoices(amount, type, status, id) Task: Find value from shipments where level appears in invoices entries with matching id. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = shp.id );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17974
train
v3
Schema: transactions (alias: txn)(value, code, type, status) items(name, type, date, code) Task: Retrieve id from transactions with amount above the AVG(value) of items rows sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17975
train
v1
Schema: shipments (alias: shp)(date, id, code, salary) sales(level, value, id, salary) Task: Find id from shipments where code appears in sales entries with matching code. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17976
train
v1
Schema: transactions (alias: txn)(id, amount, status, salary) sales(amount, id, code, value) Task: Find name from transactions where id appears in sales entries with matching code. SQL:
SELECT name FROM transactions AS txn WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17977
train
v1
Schema: requests (alias: ordr)(code, type, level, date) customers(type, date, name, status) Task: Select amount from requests where type exists in customers for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17978
train
v1
Schema: products (alias: prod)(code, name, value, status) requests(name, id, salary, status) Task: Retrieve salary from products whose type is found in requests rows where code matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17979
train
v3
Schema: regions (alias: rgn)(level, value, type, code) orders(status, level, id, type) Task: Retrieve salary from regions with value above the COUNT(amount) of orders rows sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17980
train
v3
Schema: accounts (alias: acct)(status, name, salary, date) branches(date, amount, value, id) Task: Find name from accounts where salary exceeds the minimum amount from branches for the same status. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17981
train
v3
Schema: tasks (alias: tsk)(id, date, level, value) accounts(value, name, amount, code) Task: Retrieve name from tasks with value above the MAX(amount) of accounts rows sharing the same level. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17982
train
v2
Schema: projects (alias: prj)(status, amount, name, value) products(value, type, amount, level) Task: Find id from projects where a matching record exists in products with the same status. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = prj.status );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17983
train
v3
Schema: tasks (alias: tsk)(status, level, name, date) regions(code, status, date, level) Task: Find name from tasks where salary exceeds the maximum salary from regions for the same status. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17984
train
v1
Schema: managers (alias: mgr)(amount, status, type, name) requests(code, value, level, id) Task: Find id from managers where id appears in requests entries with matching id. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.id = mgr.id );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17985
train
v1
Schema: projects (alias: prj)(date, salary, id, type) employees(salary, level, name, id) Task: Retrieve name from projects whose level is found in employees rows where status matches the outer record. SQL:
SELECT name FROM projects AS prj WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = prj.status );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17986
train
v2
Schema: items (alias: lne)(name, date, salary, code) schedules(value, type, level, id) Task: Find code from items where a matching record exists in schedules with the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = lne.id );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17987
train
v2
Schema: staff (alias: empl)(amount, name, status, type) schedules(name, level, type, id) Task: Retrieve code from staff that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = empl.level );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17988
train
v2
Schema: branches (alias: brc)(id, amount, level, name) requests(status, type, date, id) Task: Find salary from branches where a matching record exists in requests with the same type. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = brc.type );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17989
train
v1
Schema: projects (alias: prj)(salary, code, type, amount) sales(name, status, date, level) Task: Find salary from projects where status appears in sales entries with matching status. SQL:
SELECT salary FROM projects AS prj WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = prj.status );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17990
train
v3
Schema: departments (alias: dept)(name, value, id, type) accounts(name, amount, salary, type) Task: Find name from departments where salary exceeds the minimum value from accounts for the same type. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17991
train
v2
Schema: staff (alias: empl)(code, date, value, amount) departments(type, salary, value, level) Task: Find value from staff where a matching record exists in departments with the same id. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = empl.id );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "value", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17992
train
v3
Schema: projects (alias: prj)(salary, date, id, status) managers(name, code, status, value) Task: Find salary from projects where salary exceeds the count of value from managers for the same status. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.status = prj.status );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17993
train
v2
Schema: departments (alias: dept)(code, status, date, name) schedules(value, date, code, level) Task: Retrieve salary from departments that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = dept.status );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17994
train
v3
Schema: managers (alias: mgr)(code, type, id, level) regions(name, salary, level, status) Task: Retrieve name from managers with amount above the MIN(value) of regions rows sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17995
train
v2
Schema: managers (alias: mgr)(type, code, value, level) employees(date, value, name, amount) Task: Find salary from managers where a matching record exists in employees with the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17996
train
v3
Schema: projects (alias: prj)(salary, level, id, amount) requests(value, date, name, status) Task: Retrieve name from projects with amount above the SUM(salary) of requests rows sharing the same level. SQL:
SELECT name FROM projects AS prj WHERE amount > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.level = prj.level );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17997
train
v1
Schema: categories (alias: catg)(value, status, name, level) customers(level, name, date, value) Task: Find value from categories where id appears in customers entries with matching level. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17998
train
v3
Schema: shipments (alias: shp)(type, amount, status, level) departments(id, level, amount, date) Task: Find amount from shipments where amount exceeds the average value from departments for the same code. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17999
train