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: orders (alias: ord)(type, salary, value, date) transactions(code, salary, value, date) Task: Retrieve value from orders that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12900
train
v3
Schema: projects (alias: prj)(value, date, id, code) tasks(amount, salary, level, type) Task: Retrieve salary from projects with value above the AVG(amount) of tasks rows sharing the same type. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.type = prj.type );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12901
train
v3
Schema: employees (alias: emp)(date, code, name, value) staff(level, name, amount, status) Task: Find value from employees where amount exceeds the minimum amount from staff for the same code. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12902
train
v1
Schema: regions (alias: rgn)(salary, code, level, name) transactions(code, amount, date, type) Task: Find name from regions where type appears in transactions entries with matching code. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12903
train
v1
Schema: customers (alias: cust)(status, salary, date, value) categories(code, salary, level, date) Task: Select salary from customers where code exists in categories for the same code. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12904
train
v3
Schema: projects (alias: prj)(id, status, level, value) tasks(id, level, salary, code) Task: Retrieve id from projects with value above the MIN(amount) of tasks rows sharing the same level. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.level = prj.level );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12905
train
v3
Schema: regions (alias: rgn)(type, salary, status, name) accounts(name, code, amount, level) Task: Find salary from regions where amount exceeds the maximum value from accounts for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12906
train
v3
Schema: categories (alias: catg)(id, value, date, name) items(salary, date, value, level) Task: Find code from categories where amount exceeds the count of salary from items for the same id. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12907
train
v1
Schema: schedules (alias: schd)(amount, date, id, name) shipments(amount, type, date, code) Task: Retrieve amount from schedules whose code is found in shipments rows where level matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12908
train
v1
Schema: invoices (alias: inv)(status, code, value, date) employees(level, date, status, amount) Task: Retrieve id from invoices whose code is found in employees rows where level matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12909
train
v3
Schema: tasks (alias: tsk)(amount, level, type, code) regions(salary, name, status, type) Task: Retrieve id from tasks with salary above the SUM(value) of regions rows sharing the same id. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12910
train
v3
Schema: departments (alias: dept)(code, name, date, amount) accounts(amount, id, value, code) Task: Find id from departments where value exceeds the minimum value from accounts for the same id. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12911
train
v2
Schema: invoices (alias: inv)(code, status, date, name) products(date, salary, value, status) Task: Find value from invoices where a matching record exists in products with the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12912
train
v2
Schema: accounts (alias: acct)(amount, status, id, value) shipments(date, level, type, status) Task: Find salary from accounts where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12913
train
v3
Schema: requests (alias: ordr)(level, name, code, amount) projects(code, id, amount, status) Task: Find code from requests where value exceeds the maximum amount from projects for the same code. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.code = ordr.code );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12914
train
v2
Schema: managers (alias: mgr)(code, name, type, level) projects(salary, amount, status, name) Task: Find amount from managers where a matching record exists in projects with the same level. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = mgr.level );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "amount", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12915
train
v1
Schema: employees (alias: emp)(status, code, value, name) products(level, value, amount, salary) Task: Find amount from employees where status appears in products entries with matching code. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = emp.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12916
train
v1
Schema: invoices (alias: inv)(code, level, amount, name) accounts(date, level, salary, code) Task: Find salary from invoices where level appears in accounts entries with matching type. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = inv.type );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12917
train
v1
Schema: regions (alias: rgn)(amount, level, status, salary) accounts(date, id, status, salary) Task: Find salary from regions where type appears in accounts entries with matching level. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = rgn.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12918
train
v2
Schema: tasks (alias: tsk)(code, level, name, id) projects(name, salary, amount, code) Task: Find id from tasks where a matching record exists in projects with the same id. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12919
train
v3
Schema: managers (alias: mgr)(code, status, name, amount) staff(value, salary, type, level) Task: Retrieve id from managers with value above the AVG(value) of staff rows sharing the same id. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12920
train
v1
Schema: customers (alias: cust)(id, status, name, value) orders(status, code, date, id) Task: Find id from customers where status appears in orders entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12921
train
v2
Schema: categories (alias: catg)(level, salary, id, value) transactions(salary, code, id, status) Task: Find name from categories where a matching record exists in transactions with the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12922
train
v2
Schema: orders (alias: ord)(name, date, id, code) schedules(amount, value, salary, date) Task: Retrieve name from orders that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12923
train
v3
Schema: schedules (alias: schd)(type, code, value, name) transactions(id, date, value, amount) Task: Find amount from schedules where salary exceeds the count of salary from transactions for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12924
train
v1
Schema: categories (alias: catg)(value, status, id, salary) accounts(value, status, level, type) Task: Select amount from categories where code exists in accounts for the same level. SQL:
SELECT amount FROM categories AS catg WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12925
train
v2
Schema: tasks (alias: tsk)(id, status, value, amount) accounts(type, name, amount, status) Task: Find name from tasks where a matching record exists in accounts with the same code. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12926
train
v3
Schema: accounts (alias: acct)(type, id, date, amount) categories(amount, name, value, level) Task: Retrieve name from accounts with amount above the MAX(value) of categories rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MAX(value) FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12927
train
v2
Schema: accounts (alias: acct)(date, type, name, amount) departments(status, name, id, amount) Task: Find id from accounts where a matching record exists in departments with the same id. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12928
train
v1
Schema: branches (alias: brc)(amount, status, id, name) requests(value, code, id, salary) Task: Find code from branches where id appears in requests entries with matching type. SQL:
SELECT code FROM branches AS brc WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.type = brc.type );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12929
train
v2
Schema: customers (alias: cust)(salary, date, name, status) employees(id, level, status, salary) Task: Find id from customers where a matching record exists in employees with the same type. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = cust.type );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12930
train
v3
Schema: tasks (alias: tsk)(name, date, value, code) products(salary, level, status, id) Task: Find code from tasks where amount exceeds the maximum salary from products for the same type. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT MAX(salary) FROM products AS prod WHERE prod.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12931
train
v3
Schema: sales (alias: sale)(code, amount, date, name) invoices(status, id, code, value) Task: Retrieve id from sales with value above the COUNT(amount) of invoices rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12932
train
v2
Schema: employees (alias: emp)(type, id, date, status) products(status, date, level, name) Task: Retrieve value from employees that have at least one corresponding entry in products sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = emp.type );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12933
train
v3
Schema: invoices (alias: inv)(level, amount, type, status) tasks(level, date, value, type) Task: Retrieve amount from invoices with salary above the MAX(salary) of tasks rows sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM tasks AS tsk WHERE tsk.status = inv.status );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12934
train
v1
Schema: managers (alias: mgr)(level, type, id, code) employees(code, amount, status, id) Task: Find value from managers where code appears in employees entries with matching level. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12935
train
v1
Schema: accounts (alias: acct)(type, name, value, amount) requests(salary, amount, status, type) Task: Select name from accounts where level exists in requests for the same status. SQL:
SELECT name FROM accounts AS acct WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12936
train
v3
Schema: invoices (alias: inv)(amount, name, status, salary) tasks(status, name, salary, level) Task: Find value from invoices where amount exceeds the minimum amount from tasks for the same level. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.level = inv.level );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12937
train
v2
Schema: managers (alias: mgr)(salary, id, code, name) requests(date, level, salary, amount) Task: Retrieve salary from managers that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12938
train
v3
Schema: categories (alias: catg)(type, value, id, status) orders(amount, salary, level, code) Task: Retrieve code from categories with amount above the SUM(amount) of orders rows sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.type = catg.type );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12939
train
v1
Schema: managers (alias: mgr)(value, level, code, date) items(status, code, salary, level) Task: Find amount from managers where status appears in items entries with matching type. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = mgr.type );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12940
train
v1
Schema: transactions (alias: txn)(status, amount, value, code) products(code, amount, salary, value) Task: Find value from transactions where type appears in products entries with matching code. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM products AS prod WHERE prod.code = txn.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12941
train
v3
Schema: employees (alias: emp)(type, id, name, date) customers(type, code, date, id) Task: Find code from employees where salary exceeds the total value from customers for the same level. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12942
train
v1
Schema: invoices (alias: inv)(date, salary, amount, value) shipments(value, status, amount, id) Task: Retrieve name from invoices whose type is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12943
train
v3
Schema: categories (alias: catg)(date, code, name, amount) departments(id, salary, code, status) Task: Find name from categories where salary exceeds the maximum value from departments for the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MAX(value) FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12944
train
v3
Schema: accounts (alias: acct)(code, id, date, level) shipments(code, salary, name, level) Task: Find value from accounts where salary exceeds the count of amount from shipments for the same code. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12945
train
v1
Schema: requests (alias: ordr)(date, salary, type, id) employees(amount, name, date, status) Task: Select code from requests where status exists in employees for the same id. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12946
train
v1
Schema: shipments (alias: shp)(status, code, id, name) accounts(code, level, date, status) Task: Find amount from shipments where level appears in accounts entries with matching id. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12947
train
v2
Schema: products (alias: prod)(type, id, level, code) items(date, salary, status, level) Task: Retrieve salary from products that have at least one corresponding entry in items sharing the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = prod.level );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12948
train
v3
Schema: tasks (alias: tsk)(salary, value, date, id) staff(status, salary, type, name) Task: Retrieve value from tasks with salary above the MIN(value) of staff rows sharing the same id. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12949
train
v3
Schema: customers (alias: cust)(id, type, level, amount) staff(amount, salary, id, level) Task: Find value from customers where salary exceeds the maximum amount from staff for the same id. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12950
train
v3
Schema: projects (alias: prj)(date, salary, value, level) managers(salary, date, type, level) Task: Find value from projects where salary exceeds the count of salary from managers for the same status. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.status = prj.status );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12951
train
v3
Schema: orders (alias: ord)(type, salary, amount, value) tasks(amount, value, date, status) Task: Find amount from orders where amount exceeds the minimum amount from tasks for the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.code = ord.code );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12952
train
v2
Schema: projects (alias: prj)(type, id, code, amount) branches(level, name, salary, status) Task: Find code from projects where a matching record exists in branches with the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12953
train
v2
Schema: transactions (alias: txn)(value, type, amount, id) categories(type, amount, date, id) Task: Find id from transactions where a matching record exists in categories with the same type. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12954
train
v2
Schema: sales (alias: sale)(type, amount, date, id) customers(id, amount, date, type) Task: Find code from sales where a matching record exists in customers with the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12955
train
v1
Schema: schedules (alias: schd)(type, status, code, date) sales(id, level, code, salary) Task: Retrieve code from schedules whose type is found in sales rows where code matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12956
train
v2
Schema: accounts (alias: acct)(status, date, id, salary) customers(date, type, value, id) Task: Find code from accounts where a matching record exists in customers with the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12957
train
v2
Schema: requests (alias: ordr)(type, level, status, date) sales(status, salary, amount, code) Task: Find value from requests where a matching record exists in sales with the same id. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12958
train
v3
Schema: accounts (alias: acct)(id, type, salary, value) employees(status, value, type, level) Task: Find value from accounts where amount exceeds the maximum amount from employees for the same code. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12959
train
v1
Schema: managers (alias: mgr)(id, name, code, type) employees(id, level, type, value) Task: Select salary from managers where status exists in employees for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12960
train
v2
Schema: customers (alias: cust)(date, level, type, value) departments(date, status, name, level) Task: Find value from customers where a matching record exists in departments with the same code. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "value", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12961
train
v1
Schema: sales (alias: sale)(level, name, status, salary) managers(status, code, date, level) Task: Find id from sales where level appears in managers entries with matching level. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12962
train
v1
Schema: branches (alias: brc)(level, id, date, amount) employees(level, status, value, type) Task: Retrieve name from branches whose type is found in employees rows where type matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = brc.type );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12963
train
v2
Schema: staff (alias: empl)(value, salary, date, type) departments(value, level, id, status) Task: Retrieve value from staff that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12964
train
v1
Schema: regions (alias: rgn)(type, amount, name, code) staff(value, status, code, amount) Task: Retrieve name from regions whose id is found in staff rows where type matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = rgn.type );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12965
train
v2
Schema: products (alias: prod)(salary, name, amount, code) transactions(salary, id, date, status) Task: Find code from products where a matching record exists in transactions with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = prod.level );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12966
train
v1
Schema: orders (alias: ord)(value, type, code, status) sales(date, code, id, amount) Task: Find salary from orders where code appears in sales entries with matching type. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12967
train
v2
Schema: tasks (alias: tsk)(salary, level, date, value) transactions(id, code, level, value) Task: Find value from tasks where a matching record exists in transactions with the same code. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12968
train
v1
Schema: items (alias: lne)(code, name, id, date) categories(date, value, amount, salary) Task: Select amount from items where type exists in categories for the same id. SQL:
SELECT amount FROM items AS lne WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12969
train
v1
Schema: customers (alias: cust)(name, value, id, amount) categories(status, salary, name, type) Task: Retrieve id from customers whose level is found in categories rows where id matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = cust.id );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12970
train
v2
Schema: tasks (alias: tsk)(id, salary, code, type) projects(level, id, type, code) Task: Retrieve amount from tasks that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "amount", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12971
train
v1
Schema: employees (alias: emp)(value, type, code, salary) tasks(name, level, date, amount) Task: Retrieve salary from employees whose id is found in tasks rows where code matches the outer record. 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_12972
train
v3
Schema: shipments (alias: shp)(value, id, name, salary) managers(value, level, date, name) Task: Find value from shipments where value exceeds the total value from managers for the same id. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12973
train
v2
Schema: regions (alias: rgn)(id, salary, date, amount) staff(type, value, amount, status) Task: Find name from regions where a matching record exists in staff with the same code. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12974
train
v2
Schema: customers (alias: cust)(status, amount, id, code) categories(id, level, name, amount) Task: Retrieve code from customers that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12975
train
v2
Schema: accounts (alias: acct)(date, level, salary, type) items(value, status, level, id) Task: Retrieve code from accounts that have at least one corresponding entry in items sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12976
train
v3
Schema: tasks (alias: tsk)(date, level, type, status) managers(code, status, value, name) Task: Find code from tasks where value exceeds the minimum amount from managers for the same type. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12977
train
v1
Schema: projects (alias: prj)(type, status, amount, value) products(value, amount, salary, date) Task: Find name from projects where id appears in products entries with matching id. SQL:
SELECT name FROM projects AS prj WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = prj.id );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12978
train
v2
Schema: requests (alias: ordr)(type, date, salary, status) projects(amount, status, id, level) Task: Find code from requests where a matching record exists in projects with the same level. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12979
train
v3
Schema: departments (alias: dept)(code, id, status, amount) requests(amount, type, status, value) Task: Find name from departments where value exceeds the count of amount from requests for the same status. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12980
train
v1
Schema: customers (alias: cust)(value, salary, status, date) tasks(salary, value, id, amount) Task: Select name from customers where code exists in tasks for the same id. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = cust.id );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12981
train
v1
Schema: sales (alias: sale)(status, name, type, date) schedules(type, name, value, level) Task: Retrieve amount from sales whose type is found in schedules rows where type matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12982
train
v2
Schema: projects (alias: prj)(type, code, value, name) employees(value, date, salary, level) Task: Find amount from projects where a matching record exists in employees with the same status. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = prj.status );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "amount", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12983
train
v1
Schema: products (alias: prod)(salary, name, status, code) requests(type, salary, date, level) Task: Retrieve amount from products whose level is found in requests rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12984
train
v1
Schema: shipments (alias: shp)(level, id, date, type) orders(type, salary, name, id) Task: Select value from shipments where code exists in orders for the same status. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12985
train
v2
Schema: items (alias: lne)(amount, value, date, name) invoices(value, date, status, salary) Task: Find salary from items where a matching record exists in invoices with the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12986
train
v1
Schema: sales (alias: sale)(level, salary, type, id) projects(name, status, amount, value) Task: Select code from sales where status exists in projects for the same id. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12987
train
v1
Schema: invoices (alias: inv)(date, name, level, code) branches(salary, value, status, level) Task: Find id from invoices where id appears in branches entries with matching id. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12988
train
v2
Schema: staff (alias: empl)(date, id, type, level) shipments(value, code, type, name) Task: Retrieve code from staff that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12989
train
v1
Schema: projects (alias: prj)(level, code, name, value) orders(status, amount, code, salary) Task: Retrieve id from projects whose id is found in orders rows where type matches the outer record. SQL:
SELECT id FROM projects AS prj WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = prj.type );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12990
train
v1
Schema: tasks (alias: tsk)(name, id, status, amount) staff(name, id, value, status) Task: Retrieve value from tasks whose id is found in staff rows where status matches the outer record. SQL:
SELECT value FROM tasks AS tsk WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12991
train
v3
Schema: orders (alias: ord)(amount, level, value, code) projects(id, status, code, date) Task: Retrieve amount from orders with salary above the AVG(value) of projects rows sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT AVG(value) FROM projects AS prj WHERE prj.type = ord.type );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12992
train
v3
Schema: departments (alias: dept)(salary, code, type, status) orders(salary, name, status, type) Task: Find code from departments where amount exceeds the maximum salary from orders for the same status. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12993
train
v2
Schema: regions (alias: rgn)(code, date, level, value) branches(date, value, level, salary) Task: Retrieve salary from regions that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12994
train
v2
Schema: products (alias: prod)(status, code, level, id) staff(level, status, value, id) Task: Find name from products where a matching record exists in staff with the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = prod.code );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12995
train
v3
Schema: products (alias: prod)(date, level, name, status) orders(amount, value, salary, status) Task: Retrieve code from products with amount above the COUNT(amount) of orders rows sharing the same status. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12996
train
v1
Schema: sales (alias: sale)(date, code, value, id) tasks(level, amount, id, code) Task: Retrieve code from sales whose code is found in tasks rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code 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": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12997
train
v1
Schema: managers (alias: mgr)(type, id, salary, code) employees(amount, date, value, level) Task: Select name from managers where status exists in employees for the same type. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12998
train
v3
Schema: sales (alias: sale)(code, salary, status, amount) orders(amount, id, salary, status) Task: Retrieve id from sales with value above the SUM(salary) of orders rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = sale.id );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12999
train