variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v1
Schema: items (alias: lne)(id, level, value, status) shipments(type, id, amount, value) Task: Retrieve name from items whose type is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = lne.code );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05900
train
v1
Schema: items (alias: lne)(amount, date, salary, name) regions(name, id, value, date) Task: Retrieve id from items whose type is found in regions rows where code matches the outer record. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05901
train
v1
Schema: products (alias: prod)(status, level, amount, salary) tasks(salary, id, date, status) Task: Select amount from products where level exists in tasks for the same type. SQL:
SELECT amount FROM products AS prod WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05902
train
v3
Schema: categories (alias: catg)(code, name, date, level) transactions(type, code, status, level) Task: Retrieve amount from categories with amount above the COUNT(amount) of transactions rows sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05903
train
v1
Schema: accounts (alias: acct)(status, code, value, level) schedules(salary, status, amount, code) Task: Retrieve id from accounts whose type is found in schedules rows where level matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = acct.level );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05904
train
v2
Schema: tasks (alias: tsk)(value, id, amount, type) shipments(amount, code, date, salary) Task: Retrieve id from tasks that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05905
train
v3
Schema: employees (alias: emp)(name, id, type, level) items(date, salary, level, id) Task: Retrieve salary from employees with salary above the COUNT(amount) of items rows sharing the same id. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.id = emp.id );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05906
train
v3
Schema: requests (alias: ordr)(amount, date, name, salary) transactions(amount, salary, id, status) Task: Find amount from requests where value exceeds the total salary from transactions for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05907
train
v3
Schema: staff (alias: empl)(salary, status, date, value) invoices(code, amount, type, salary) Task: Find name from staff where amount exceeds the maximum value from invoices for the same level. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.level = empl.level );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05908
train
v2
Schema: shipments (alias: shp)(code, amount, level, salary) projects(code, name, id, value) Task: Find name from shipments where a matching record exists in projects with the same type. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = shp.type );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05909
train
v1
Schema: regions (alias: rgn)(date, level, value, id) orders(id, salary, amount, code) Task: Find amount from regions where status appears in orders entries with matching status. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05910
train
v3
Schema: sales (alias: sale)(date, code, id, name) invoices(date, status, value, salary) Task: Find value from sales where value exceeds the total value from invoices for the same level. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05911
train
v2
Schema: regions (alias: rgn)(amount, name, type, salary) employees(amount, salary, value, code) Task: Find code from regions where a matching record exists in employees with the same status. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05912
train
v3
Schema: projects (alias: prj)(level, date, code, type) regions(status, type, id, date) Task: Find id from projects where amount exceeds the total salary from regions for the same status. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.status = prj.status );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05913
train
v3
Schema: invoices (alias: inv)(level, status, date, code) items(type, amount, name, salary) Task: Retrieve salary from invoices with amount above the MIN(value) of items rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05914
train
v2
Schema: customers (alias: cust)(status, id, code, amount) requests(name, status, value, salary) Task: Find name from customers where a matching record exists in requests with the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = cust.status );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05915
train
v3
Schema: requests (alias: ordr)(level, type, code, status) employees(id, salary, type, code) Task: Retrieve name from requests with salary above the SUM(value) of employees rows sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT SUM(value) FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05916
train
v1
Schema: staff (alias: empl)(id, level, date, status) invoices(value, type, level, name) Task: Select id from staff where status exists in invoices for the same id. SQL:
SELECT id FROM staff AS empl WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = empl.id );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05917
train
v1
Schema: transactions (alias: txn)(salary, type, value, name) staff(amount, name, salary, level) Task: Retrieve id from transactions whose id is found in staff rows where type matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05918
train
v3
Schema: products (alias: prod)(level, date, amount, status) customers(value, code, level, type) Task: Find salary from products where amount exceeds the total salary from customers for the same id. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05919
train
v3
Schema: invoices (alias: inv)(id, code, type, name) branches(amount, name, value, status) Task: Find value from invoices where value exceeds the maximum amount from branches for the same code. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.code = inv.code );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05920
train
v2
Schema: requests (alias: ordr)(code, value, type, id) shipments(id, amount, type, salary) Task: Retrieve name from requests that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05921
train
v3
Schema: departments (alias: dept)(value, status, type, name) managers(code, value, name, date) Task: Retrieve id from departments with amount above the AVG(value) of managers rows sharing the same id. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05922
train
v2
Schema: managers (alias: mgr)(salary, amount, type, value) tasks(name, level, status, salary) Task: Retrieve id from managers that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = mgr.id );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05923
train
v1
Schema: items (alias: lne)(status, level, type, amount) projects(type, level, name, status) Task: Select amount from items where type exists in projects for the same status. SQL:
SELECT amount FROM items AS lne WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = lne.status );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05924
train
v3
Schema: sales (alias: sale)(code, id, date, type) accounts(status, id, level, name) Task: Find value from sales where value exceeds the count of value from accounts for the same type. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05925
train
v3
Schema: staff (alias: empl)(id, code, amount, level) managers(code, level, type, name) Task: Retrieve code from staff with value above the COUNT(salary) of managers rows sharing the same type. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05926
train
v2
Schema: tasks (alias: tsk)(id, code, type, status) accounts(status, salary, date, value) Task: Retrieve amount from tasks that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05927
train
v3
Schema: invoices (alias: inv)(amount, code, status, level) items(name, salary, code, level) Task: Retrieve id from invoices with amount above the MIN(amount) of items rows sharing the same level. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM items AS lne WHERE lne.level = inv.level );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "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_05928
train
v2
Schema: transactions (alias: txn)(code, date, salary, amount) shipments(level, code, id, date) Task: Retrieve id from transactions that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05929
train
v1
Schema: departments (alias: dept)(type, status, salary, amount) invoices(level, id, type, value) Task: Select value from departments where status exists in invoices for the same id. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = dept.id );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05930
train
v3
Schema: accounts (alias: acct)(name, type, level, id) managers(status, id, salary, amount) Task: Retrieve id from accounts with amount above the COUNT(salary) of managers rows sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05931
train
v2
Schema: employees (alias: emp)(salary, status, id, date) managers(status, value, type, date) Task: Retrieve code from employees that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = emp.level );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05932
train
v3
Schema: items (alias: lne)(value, salary, id, amount) transactions(salary, value, date, level) Task: Find code from items where salary exceeds the minimum value from transactions for the same type. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05933
train
v1
Schema: transactions (alias: txn)(level, status, name, id) products(name, amount, status, value) Task: Find value from transactions where id appears in products entries with matching code. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id 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": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05934
train
v1
Schema: accounts (alias: acct)(name, salary, status, id) tasks(salary, name, level, status) Task: Retrieve id from accounts whose status is found in tasks rows where id matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05935
train
v1
Schema: employees (alias: emp)(level, status, id, code) categories(amount, code, name, date) Task: Retrieve name from employees whose status is found in categories rows where code matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05936
train
v1
Schema: accounts (alias: acct)(status, type, id, date) invoices(name, status, amount, type) Task: Retrieve amount from accounts whose level is found in invoices rows where id matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05937
train
v3
Schema: employees (alias: emp)(code, status, name, salary) orders(type, status, value, level) Task: Find salary from employees where salary exceeds the maximum amount from orders for the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05938
train
v3
Schema: invoices (alias: inv)(salary, value, code, level) projects(salary, level, value, id) Task: Find code from invoices where salary exceeds the maximum value from projects for the same level. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM projects AS prj WHERE prj.level = inv.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05939
train
v2
Schema: tasks (alias: tsk)(name, type, code, id) items(level, salary, code, value) Task: Find salary from tasks where a matching record exists in items with the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "salary", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05940
train
v1
Schema: accounts (alias: acct)(name, value, type, id) shipments(id, status, level, amount) Task: Retrieve value from accounts whose level is found in shipments rows where code matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level 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": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05941
train
v3
Schema: regions (alias: rgn)(date, amount, id, value) transactions(amount, salary, status, value) Task: Find id from regions where value exceeds the count of value from transactions for the same id. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.id = rgn.id );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05942
train
v2
Schema: branches (alias: brc)(level, date, id, value) employees(name, status, date, salary) Task: Retrieve salary from branches that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = brc.type );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05943
train
v3
Schema: products (alias: prod)(level, name, type, status) invoices(value, name, code, status) Task: Retrieve code from products with amount above the MAX(value) of invoices rows sharing the same level. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05944
train
v1
Schema: staff (alias: empl)(name, value, amount, date) shipments(salary, amount, value, status) Task: Find value from staff where type appears in shipments entries with matching status. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05945
train
v3
Schema: managers (alias: mgr)(id, value, amount, type) sales(level, amount, id, code) Task: Find code from managers where value exceeds the total amount from sales for the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05946
train
v2
Schema: projects (alias: prj)(level, status, amount, name) tasks(level, date, value, amount) Task: Find salary from projects where a matching record exists in tasks with the same id. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = prj.id );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "salary", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05947
train
v3
Schema: accounts (alias: acct)(amount, date, code, level) branches(date, value, code, status) Task: Find name from accounts where amount exceeds the minimum amount from branches for the same status. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( 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": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05948
train
v3
Schema: categories (alias: catg)(type, salary, name, id) invoices(value, amount, type, code) Task: Find amount from categories where salary exceeds the maximum amount from invoices for the same type. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05949
train
v2
Schema: orders (alias: ord)(date, status, amount, level) transactions(type, id, level, status) Task: Retrieve code from orders that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05950
train
v1
Schema: branches (alias: brc)(type, amount, value, id) sales(value, salary, type, id) Task: Retrieve salary from branches whose id is found in sales rows where code matches the outer record. SQL:
SELECT salary FROM branches AS brc WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = brc.code );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05951
train
v1
Schema: products (alias: prod)(name, type, id, code) managers(amount, id, value, code) Task: Find name from products where code appears in managers entries with matching code. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05952
train
v2
Schema: departments (alias: dept)(name, code, amount, level) staff(date, name, salary, status) Task: Find value from departments where a matching record exists in staff with the same type. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05953
train
v2
Schema: categories (alias: catg)(amount, salary, value, status) transactions(code, name, level, amount) Task: Retrieve id from categories that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id 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": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05954
train
v2
Schema: requests (alias: ordr)(value, salary, name, type) products(date, type, id, name) Task: Find id from requests where a matching record exists in products with the same type. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = ordr.type );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05955
train
v2
Schema: categories (alias: catg)(id, status, code, type) sales(type, id, date, name) Task: Find salary from categories where a matching record exists in sales with the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = catg.type );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05956
train
v2
Schema: invoices (alias: inv)(type, date, name, salary) sales(name, id, status, amount) Task: Find value from invoices where a matching record exists in sales with the same code. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05957
train
v2
Schema: managers (alias: mgr)(level, name, code, value) transactions(type, code, date, id) Task: Find id from managers where a matching record exists in transactions with the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05958
train
v1
Schema: managers (alias: mgr)(amount, name, value, salary) branches(salary, date, value, status) Task: Find name from managers where code appears in branches entries with matching level. SQL:
SELECT name FROM managers AS mgr WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.level = mgr.level );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05959
train
v3
Schema: accounts (alias: acct)(date, level, salary, id) branches(salary, amount, status, value) Task: Retrieve amount from accounts with value above the MIN(salary) of branches rows sharing the same level. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.level = acct.level );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05960
train
v2
Schema: employees (alias: emp)(level, salary, amount, name) managers(status, id, value, level) Task: Retrieve amount from employees that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05961
train
v3
Schema: regions (alias: rgn)(status, value, type, name) managers(name, code, date, type) Task: Find value from regions where value exceeds the total salary from managers for the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05962
train
v2
Schema: requests (alias: ordr)(salary, amount, date, value) categories(name, type, date, id) Task: Find salary from requests where a matching record exists in categories with the same id. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05963
train
v3
Schema: items (alias: lne)(type, level, id, value) sales(date, name, code, level) Task: Retrieve amount from items with amount above the SUM(salary) of sales rows sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05964
train
v1
Schema: projects (alias: prj)(id, salary, code, level) branches(status, id, date, type) Task: Find id from projects where status appears in branches entries with matching level. SQL:
SELECT id FROM projects AS prj WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05965
train
v2
Schema: employees (alias: emp)(date, name, level, status) transactions(date, name, amount, value) Task: Retrieve amount from employees that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05966
train
v1
Schema: regions (alias: rgn)(value, code, name, date) items(code, name, status, value) Task: Find salary from regions where type appears in items entries with matching id. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = rgn.id );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05967
train
v2
Schema: orders (alias: ord)(code, value, level, status) employees(amount, name, value, code) Task: Retrieve code from orders that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05968
train
v3
Schema: branches (alias: brc)(name, id, date, code) invoices(id, salary, name, date) Task: Find amount from branches where salary exceeds the average value from invoices for the same status. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.status = brc.status );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05969
train
v3
Schema: customers (alias: cust)(salary, type, date, status) managers(code, amount, salary, type) Task: Retrieve id from customers with value above the AVG(salary) of managers rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05970
train
v1
Schema: items (alias: lne)(level, value, id, date) invoices(type, level, id, salary) Task: Find name from items where code appears in invoices entries with matching level. SQL:
SELECT name FROM items AS lne WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05971
train
v1
Schema: invoices (alias: inv)(level, salary, status, code) customers(status, id, name, level) Task: Find id from invoices where status appears in customers entries with matching type. SQL:
SELECT id FROM invoices AS inv WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05972
train
v2
Schema: tasks (alias: tsk)(type, id, code, value) managers(code, value, amount, date) Task: Find amount from tasks where a matching record exists in managers with the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05973
train
v3
Schema: staff (alias: empl)(name, status, amount, type) transactions(amount, value, name, salary) Task: Find value from staff where salary exceeds the average salary from transactions for the same status. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.status = empl.status );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05974
train
v3
Schema: shipments (alias: shp)(id, type, level, salary) employees(code, type, name, id) Task: Find id from shipments where amount exceeds the maximum salary from employees for the same level. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05975
train
v2
Schema: items (alias: lne)(code, name, status, id) schedules(level, status, type, code) Task: Find code from items where a matching record exists in schedules with the same type. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05976
train
v2
Schema: schedules (alias: schd)(id, status, type, value) tasks(date, salary, type, id) Task: Find id from schedules where a matching record exists in tasks with the same status. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = schd.status );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05977
train
v3
Schema: customers (alias: cust)(level, value, name, amount) orders(salary, amount, status, name) Task: Find id from customers where value exceeds the total salary from orders for the same id. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = cust.id );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05978
train
v3
Schema: sales (alias: sale)(level, salary, id, type) employees(id, salary, code, type) Task: Retrieve id from sales with salary above the AVG(salary) of employees rows sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = sale.status );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05979
train
v3
Schema: tasks (alias: tsk)(date, status, amount, name) products(amount, id, status, date) Task: Retrieve amount from tasks with value above the MIN(salary) of products rows sharing the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT MIN(salary) FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05980
train
v3
Schema: managers (alias: mgr)(status, type, salary, level) accounts(level, type, status, code) Task: Retrieve name from managers with value above the COUNT(salary) of accounts rows sharing the same status. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05981
train
v2
Schema: orders (alias: ord)(date, salary, id, name) branches(name, code, id, value) Task: Retrieve code from orders that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = ord.id );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05982
train
v2
Schema: products (alias: prod)(salary, code, status, name) accounts(id, level, date, code) Task: Retrieve salary from products that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05983
train
v3
Schema: customers (alias: cust)(amount, type, value, status) items(name, level, type, code) Task: Retrieve amount from customers with amount above the SUM(salary) of items rows sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM items AS lne WHERE lne.level = cust.level );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05984
train
v1
Schema: employees (alias: emp)(date, name, salary, value) orders(salary, type, amount, name) Task: Find salary from employees where id appears in orders entries with matching id. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05985
train
v3
Schema: branches (alias: brc)(salary, date, type, name) managers(value, amount, code, name) Task: Find id from branches where amount exceeds the average amount from managers for the same id. SQL:
SELECT id FROM branches AS brc WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.id = brc.id );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05986
train
v2
Schema: invoices (alias: inv)(type, salary, date, level) customers(name, amount, date, level) Task: Find id from invoices where a matching record exists in customers with the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05987
train
v3
Schema: managers (alias: mgr)(id, code, level, value) tasks(value, name, type, date) Task: Retrieve code from managers with amount above the AVG(salary) of tasks rows sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.id = mgr.id );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05988
train
v1
Schema: employees (alias: emp)(name, level, type, id) orders(name, id, status, date) Task: Retrieve code from employees whose level is found in orders rows where level matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05989
train
v1
Schema: customers (alias: cust)(code, value, name, id) products(code, type, id, name) Task: Select id from customers where type exists in products for the same level. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05990
train
v2
Schema: departments (alias: dept)(value, type, status, salary) customers(type, status, code, salary) Task: Retrieve id from departments that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05991
train
v2
Schema: customers (alias: cust)(id, level, type, amount) items(salary, status, amount, name) Task: Retrieve name from customers that have at least one corresponding entry in items sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05992
train
v3
Schema: managers (alias: mgr)(code, name, amount, level) transactions(level, salary, name, id) Task: Find value from managers where salary exceeds the count of salary from transactions for the same status. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05993
train
v1
Schema: invoices (alias: inv)(salary, code, status, id) accounts(id, value, amount, salary) Task: Find code from invoices where level appears in accounts entries with matching code. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = inv.code );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05994
train
v3
Schema: employees (alias: emp)(value, status, code, salary) departments(type, salary, name, code) Task: Retrieve id from employees with salary above the MAX(salary) of departments rows sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05995
train
v3
Schema: sales (alias: sale)(amount, value, status, id) projects(type, value, status, salary) Task: Find salary from sales where salary exceeds the maximum amount from projects for the same id. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05996
train
v1
Schema: branches (alias: brc)(name, status, level, value) managers(date, type, salary, name) Task: Retrieve code from branches whose status is found in managers rows where level matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.level = brc.level );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05997
train
v1
Schema: requests (alias: ordr)(salary, name, status, amount) customers(type, salary, id, code) Task: Find name from requests where level appears in customers entries with matching id. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05998
train
v1
Schema: projects (alias: prj)(id, level, value, salary) sales(salary, code, id, name) Task: Retrieve salary from projects whose status is found in sales rows where code matches the outer record. SQL:
SELECT salary FROM projects AS prj WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = prj.code );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05999
train