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: projects (alias: prj)(id, salary, value, type) branches(level, date, value, type) Task: Retrieve value from projects whose code is found in branches rows where code matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = prj.code );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15000
train
v1
Schema: shipments (alias: shp)(id, code, amount, salary) staff(date, status, code, id) Task: Find code from shipments where type appears in staff entries with matching status. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15001
train
v3
Schema: transactions (alias: txn)(name, salary, type, status) projects(amount, status, salary, value) Task: Find salary from transactions where salary exceeds the average salary from projects for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.code = txn.code );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15002
train
v1
Schema: products (alias: prod)(name, date, status, code) accounts(value, code, id, date) Task: Retrieve amount from products whose id is found in accounts rows where level matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15003
train
v1
Schema: tasks (alias: tsk)(code, amount, value, level) sales(id, status, amount, value) Task: Select name from tasks where status exists in sales for the same level. SQL:
SELECT name FROM tasks AS tsk WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15004
train
v2
Schema: accounts (alias: acct)(amount, code, value, salary) employees(salary, name, status, level) Task: Retrieve amount from accounts that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15005
train
v2
Schema: customers (alias: cust)(date, level, status, amount) tasks(id, amount, date, name) Task: Find value from customers where a matching record exists in tasks with the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = cust.status );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15006
train
v1
Schema: schedules (alias: schd)(value, level, type, status) invoices(id, name, type, amount) Task: Retrieve code from schedules whose level is found in invoices rows where type matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15007
train
v1
Schema: transactions (alias: txn)(amount, code, name, salary) managers(amount, name, date, value) Task: Retrieve salary from transactions whose status is found in managers rows where status matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15008
train
v1
Schema: products (alias: prod)(code, type, name, id) transactions(salary, name, amount, status) Task: Select value from products where type exists in transactions for the same type. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15009
train
v3
Schema: products (alias: prod)(code, amount, type, status) branches(code, amount, name, type) Task: Retrieve salary from products with amount above the AVG(salary) of branches rows sharing the same level. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.level = prod.level );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15010
train
v3
Schema: requests (alias: ordr)(type, amount, status, id) departments(code, amount, level, date) Task: Retrieve code from requests with value above the MIN(amount) of departments rows sharing the same id. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.id = ordr.id );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15011
train
v3
Schema: branches (alias: brc)(status, value, salary, id) schedules(salary, code, id, amount) Task: Retrieve salary from branches with amount above the COUNT(amount) of schedules rows sharing the same code. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15012
train
v3
Schema: managers (alias: mgr)(status, level, name, value) shipments(salary, level, id, type) Task: Retrieve code from managers with amount above the COUNT(value) of shipments rows sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15013
train
v1
Schema: orders (alias: ord)(id, status, value, salary) requests(amount, date, value, level) Task: Select value from orders where code exists in requests for the same level. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15014
train
v2
Schema: regions (alias: rgn)(type, level, date, id) products(id, date, value, salary) Task: Find amount from regions where a matching record exists in products with the same level. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15015
train
v1
Schema: categories (alias: catg)(name, type, date, level) employees(code, id, amount, date) Task: Retrieve value from categories whose id is found in employees rows where status matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15016
train
v1
Schema: employees (alias: emp)(name, id, amount, type) schedules(value, code, level, type) Task: Select id from employees where type exists in schedules for the same code. SQL:
SELECT id FROM employees AS emp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15017
train
v2
Schema: schedules (alias: schd)(status, value, amount, type) sales(id, value, type, salary) Task: Find name from schedules where a matching record exists in sales with the same level. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = schd.level );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15018
train
v1
Schema: employees (alias: emp)(salary, value, id, status) accounts(name, type, value, amount) Task: Retrieve id from employees whose id is found in accounts rows where type matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15019
train
v1
Schema: managers (alias: mgr)(type, value, salary, status) accounts(code, amount, type, value) Task: Find amount from managers where id appears in accounts entries with matching code. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15020
train
v1
Schema: schedules (alias: schd)(type, value, id, level) regions(date, id, code, name) Task: Select salary from schedules where type exists in regions for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15021
train
v1
Schema: projects (alias: prj)(value, salary, type, date) branches(type, date, level, amount) Task: Retrieve code from projects whose type is found in branches rows where code matches the outer record. SQL:
SELECT code FROM projects AS prj WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = prj.code );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15022
train
v3
Schema: regions (alias: rgn)(level, salary, status, type) branches(name, level, status, code) Task: Find code from regions where value exceeds the total value from branches for the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT SUM(value) FROM branches AS brc WHERE brc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15023
train
v2
Schema: products (alias: prod)(amount, code, date, type) managers(date, code, type, id) Task: Find id from products where a matching record exists in managers with the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15024
train
v1
Schema: staff (alias: empl)(salary, code, date, id) employees(level, amount, salary, date) Task: Retrieve name from staff whose level is found in employees rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15025
train
v1
Schema: employees (alias: emp)(date, code, salary, level) orders(salary, type, value, status) Task: Find id from employees where status appears in orders entries with matching type. SQL:
SELECT id FROM employees AS emp WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15026
train
v2
Schema: customers (alias: cust)(id, level, code, amount) items(type, name, amount, code) Task: Retrieve value from customers that have at least one corresponding entry in items sharing the same type. SQL:
SELECT value 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": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15027
train
v2
Schema: regions (alias: rgn)(value, name, code, level) sales(code, type, level, date) Task: Find salary from regions where a matching record exists in sales with the same status. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = rgn.status );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15028
train
v2
Schema: requests (alias: ordr)(value, status, type, amount) departments(salary, amount, value, name) Task: Find value from requests where a matching record exists in departments with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = ordr.level );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15029
train
v1
Schema: sales (alias: sale)(salary, id, name, level) managers(type, level, code, amount) Task: Find amount from sales where id appears in managers entries with matching status. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15030
train
v2
Schema: employees (alias: emp)(salary, id, code, level) customers(salary, name, code, type) Task: Retrieve name from employees that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15031
train
v1
Schema: employees (alias: emp)(amount, code, level, salary) projects(amount, level, type, id) Task: Retrieve code from employees whose status is found in projects rows where status matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.status = emp.status );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15032
train
v2
Schema: customers (alias: cust)(status, name, id, type) orders(status, type, name, value) Task: Retrieve code from customers that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = cust.id );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15033
train
v3
Schema: shipments (alias: shp)(level, id, name, value) managers(date, name, level, id) Task: Retrieve salary from shipments with amount above the MAX(salary) of managers rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15034
train
v1
Schema: departments (alias: dept)(salary, value, level, amount) categories(date, type, value, name) Task: Select salary from departments where code exists in categories for the same level. SQL:
SELECT salary FROM departments AS dept WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15035
train
v3
Schema: staff (alias: empl)(date, amount, type, name) items(type, salary, code, id) Task: Retrieve salary from staff with value above the AVG(salary) of items rows sharing the same level. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15036
train
v1
Schema: departments (alias: dept)(amount, code, value, date) requests(value, id, amount, name) Task: Select id from departments where status exists in requests for the same status. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15037
train
v3
Schema: tasks (alias: tsk)(value, level, status, code) orders(date, type, amount, id) Task: Find amount from tasks where salary exceeds the total amount from orders for the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15038
train
v2
Schema: departments (alias: dept)(amount, type, value, code) requests(code, status, id, salary) Task: Retrieve amount from departments that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15039
train
v2
Schema: tasks (alias: tsk)(level, id, amount, status) accounts(type, name, id, level) Task: Find id from tasks where a matching record exists in accounts with the same level. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15040
train
v1
Schema: transactions (alias: txn)(amount, id, salary, value) branches(value, date, level, name) Task: Find name from transactions where id appears in branches entries with matching type. SQL:
SELECT name FROM transactions AS txn WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15041
train
v2
Schema: invoices (alias: inv)(amount, value, status, code) customers(salary, type, amount, status) Task: Find salary from invoices where a matching record exists in customers with the same code. SQL:
SELECT salary 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": "salary", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15042
train
v1
Schema: items (alias: lne)(name, date, salary, code) departments(date, status, code, name) Task: Find name from items where type appears in departments entries with matching type. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = lne.type );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15043
train
v1
Schema: items (alias: lne)(level, id, type, salary) sales(amount, value, code, type) Task: Retrieve name from items whose type is found in sales rows where status matches the outer record. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15044
train
v2
Schema: items (alias: lne)(level, amount, name, date) departments(value, type, level, status) Task: Find salary from items where a matching record exists in departments with the same status. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15045
train
v3
Schema: shipments (alias: shp)(date, status, salary, code) staff(type, name, status, date) Task: Retrieve amount from shipments with salary above the AVG(amount) of staff rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.code = shp.code );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15046
train
v3
Schema: transactions (alias: txn)(status, salary, level, type) orders(id, status, date, salary) Task: Find value from transactions where amount exceeds the maximum amount from orders for the same status. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.status = txn.status );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15047
train
v1
Schema: items (alias: lne)(value, amount, type, code) employees(value, name, type, code) Task: Retrieve id from items whose level is found in employees rows where code matches the outer record. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15048
train
v3
Schema: sales (alias: sale)(name, value, type, date) shipments(level, name, salary, status) Task: Retrieve name from sales with salary above the SUM(value) of shipments rows sharing the same status. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15049
train
v3
Schema: transactions (alias: txn)(type, id, value, level) requests(code, salary, date, name) Task: Find amount from transactions where amount exceeds the minimum amount from requests for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15050
train
v3
Schema: requests (alias: ordr)(value, name, level, salary) staff(id, amount, code, type) Task: Retrieve value from requests with amount above the MAX(value) of staff rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT MAX(value) FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15051
train
v3
Schema: regions (alias: rgn)(value, id, type, status) branches(code, id, salary, status) Task: Find name from regions where amount exceeds the average amount from branches for the same level. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT AVG(amount) FROM branches AS brc WHERE brc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15052
train
v2
Schema: managers (alias: mgr)(level, name, id, date) departments(status, amount, value, level) Task: Retrieve name from managers that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15053
train
v3
Schema: schedules (alias: schd)(id, level, salary, date) accounts(id, level, status, amount) Task: Retrieve id from schedules with value above the MIN(value) of accounts rows sharing the same code. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.code = schd.code );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15054
train
v3
Schema: departments (alias: dept)(date, code, value, status) categories(level, amount, value, code) Task: Find value from departments where salary exceeds the average value from categories for the same status. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT AVG(value) FROM categories AS catg WHERE catg.status = dept.status );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15055
train
v1
Schema: employees (alias: emp)(code, level, amount, status) customers(status, type, value, name) Task: Find salary from employees where id appears in customers entries with matching code. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15056
train
v3
Schema: employees (alias: emp)(type, salary, id, date) products(amount, type, id, value) Task: Retrieve amount from employees with salary above the MIN(amount) of products rows sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM products AS prod WHERE prod.level = emp.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15057
train
v3
Schema: tasks (alias: tsk)(type, level, value, status) managers(level, code, salary, amount) Task: Retrieve code from tasks with value above the MAX(amount) of managers rows sharing the same id. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15058
train
v2
Schema: products (alias: prod)(salary, amount, date, level) invoices(amount, code, type, id) Task: Retrieve name from products that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15059
train
v1
Schema: managers (alias: mgr)(id, name, code, amount) branches(status, name, level, type) Task: Select name from managers where code exists in branches for the same 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_15060
train
v3
Schema: tasks (alias: tsk)(value, amount, salary, name) orders(amount, id, salary, status) Task: Retrieve value from tasks with value above the MIN(salary) of orders rows sharing the same status. SQL:
SELECT value FROM tasks AS tsk WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15061
train
v3
Schema: shipments (alias: shp)(name, type, id, status) managers(status, date, value, id) Task: Find name from shipments where amount exceeds the average salary from managers for the same level. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15062
train
v1
Schema: accounts (alias: acct)(id, amount, date, level) invoices(code, salary, amount, id) Task: Find value from accounts where id appears in invoices entries with matching status. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = acct.status );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15063
train
v2
Schema: invoices (alias: inv)(value, level, code, name) schedules(id, date, type, salary) Task: Retrieve value from invoices that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "value", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15064
train
v2
Schema: shipments (alias: shp)(salary, value, level, date) managers(level, id, amount, salary) Task: Retrieve name from shipments that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15065
train
v1
Schema: managers (alias: mgr)(type, level, value, id) departments(type, code, date, value) Task: Find code from managers where type appears in departments entries with matching id. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = mgr.id );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15066
train
v1
Schema: regions (alias: rgn)(amount, name, status, value) customers(level, name, status, code) Task: Find id from regions where status appears in customers entries with matching type. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15067
train
v3
Schema: projects (alias: prj)(type, name, date, salary) employees(level, value, code, amount) Task: Retrieve salary from projects with value above the MAX(amount) of employees rows sharing the same code. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.code = prj.code );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15068
train
v2
Schema: products (alias: prod)(salary, status, level, name) schedules(status, salary, type, level) Task: Retrieve id from products that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15069
train
v2
Schema: transactions (alias: txn)(date, value, id, salary) departments(type, level, salary, id) Task: Retrieve name from transactions that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = txn.type );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15070
train
v3
Schema: departments (alias: dept)(id, date, level, code) tasks(value, amount, date, name) Task: Find value from departments where amount exceeds the maximum amount from tasks for the same code. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.code = dept.code );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15071
train
v2
Schema: staff (alias: empl)(level, type, amount, date) sales(amount, id, status, name) Task: Find id from staff where a matching record exists in sales with the same type. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15072
train
v3
Schema: categories (alias: catg)(id, level, type, date) customers(type, name, value, code) Task: Retrieve value from categories with salary above the COUNT(value) of customers rows sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15073
train
v3
Schema: sales (alias: sale)(id, salary, code, value) accounts(name, code, amount, date) Task: Find amount from sales where amount exceeds the count of value from accounts for the same status. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15074
train
v3
Schema: customers (alias: cust)(amount, status, name, date) departments(salary, status, level, amount) Task: Find name from customers where salary exceeds the total salary from departments for the same status. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.status = cust.status );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15075
train
v3
Schema: products (alias: prod)(id, amount, status, value) categories(value, id, salary, type) Task: Retrieve code from products with amount above the MIN(amount) of categories rows sharing the same id. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.id = prod.id );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15076
train
v2
Schema: managers (alias: mgr)(level, salary, value, code) staff(type, status, date, id) Task: Find id from managers where a matching record exists in staff with the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15077
train
v2
Schema: transactions (alias: txn)(type, date, id, name) accounts(code, status, type, id) Task: Find name from transactions where a matching record exists in accounts with the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = txn.level );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15078
train
v3
Schema: shipments (alias: shp)(id, status, salary, type) categories(id, name, type, status) Task: Retrieve value from shipments with amount above the AVG(amount) of categories rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15079
train
v2
Schema: projects (alias: prj)(value, status, salary, amount) shipments(name, date, salary, code) Task: Retrieve code from projects that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = prj.level );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15080
train
v3
Schema: projects (alias: prj)(id, name, salary, value) categories(id, date, salary, level) Task: Find amount from projects where value exceeds the count of amount from categories for the same id. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.id = prj.id );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15081
train
v3
Schema: employees (alias: emp)(level, name, id, amount) requests(amount, status, type, code) Task: Find salary from employees where value exceeds the average salary from requests for the same type. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15082
train
v1
Schema: departments (alias: dept)(id, salary, amount, type) branches(date, code, name, amount) Task: Select value from departments where id exists in branches for the same id. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = dept.id );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15083
train
v1
Schema: shipments (alias: shp)(date, value, amount, id) accounts(salary, value, type, status) Task: Select code from shipments where type exists in accounts for the same level. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15084
train
v3
Schema: requests (alias: ordr)(date, status, amount, salary) products(level, amount, status, type) Task: Find name from requests where salary exceeds the minimum amount from products for the same code. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM products AS prod WHERE prod.code = ordr.code );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15085
train
v2
Schema: customers (alias: cust)(date, code, level, salary) tasks(name, level, type, status) Task: Find value from customers where a matching record exists in tasks with the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = cust.level );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15086
train
v1
Schema: shipments (alias: shp)(value, amount, date, status) categories(amount, date, id, status) Task: Retrieve value from shipments whose id is found in categories rows where level matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15087
train
v3
Schema: projects (alias: prj)(status, amount, value, id) orders(status, date, value, level) Task: Retrieve value from projects with salary above the MIN(salary) of orders rows sharing the same code. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15088
train
v1
Schema: schedules (alias: schd)(amount, status, name, level) products(value, id, date, amount) Task: Select code from schedules where id exists in products for the same code. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = schd.code );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15089
train
v2
Schema: accounts (alias: acct)(value, type, status, salary) invoices(salary, value, amount, status) Task: Find name from accounts where a matching record exists in invoices with the same code. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = acct.code );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "name", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15090
train
v1
Schema: managers (alias: mgr)(salary, value, name, amount) requests(code, level, status, date) Task: Retrieve id from managers whose type is found in requests rows where id matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.id = mgr.id );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15091
train
v1
Schema: staff (alias: empl)(id, value, salary, type) orders(name, date, amount, code) Task: Select salary from staff where code exists in orders for the same type. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = empl.type );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15092
train
v3
Schema: schedules (alias: schd)(id, level, type, code) staff(value, code, level, type) Task: Retrieve code from schedules with value above the MAX(salary) of staff rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15093
train
v1
Schema: invoices (alias: inv)(type, name, value, amount) orders(amount, id, salary, code) Task: Find id from invoices where id appears in orders entries with matching code. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = inv.code );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15094
train
v2
Schema: tasks (alias: tsk)(level, name, status, id) transactions(level, name, type, id) Task: Retrieve amount from tasks that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15095
train
v3
Schema: sales (alias: sale)(id, status, value, name) orders(salary, type, amount, id) Task: Retrieve id from sales with salary above the MIN(salary) of orders rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT MIN(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": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15096
train
v3
Schema: sales (alias: sale)(code, name, id, level) items(value, id, name, amount) Task: Find code from sales where value exceeds the minimum salary from items for the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15097
train
v3
Schema: tasks (alias: tsk)(name, code, level, status) managers(status, amount, code, type) Task: Retrieve value from tasks with salary above the MAX(salary) of managers rows sharing the same status. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15098
train
v3
Schema: projects (alias: prj)(value, id, status, amount) regions(level, value, salary, date) Task: Find id from projects where salary exceeds the total amount from regions for the same id. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.id = prj.id );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15099
train