variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: requests (alias: ordr)(status, id, date, type) departments(id, name, code, status) Task: Retrieve code from requests that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01900
train
v3
Schema: transactions (alias: txn)(salary, value, status, level) invoices(value, name, level, code) Task: Retrieve amount from transactions with amount above the COUNT(amount) of invoices rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01901
train
v2
Schema: managers (alias: mgr)(amount, type, value, salary) branches(type, salary, amount, level) Task: Find amount from managers where a matching record exists in branches with the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01902
train
v1
Schema: departments (alias: dept)(type, level, salary, name) categories(level, id, salary, amount) Task: Retrieve code from departments whose level is found in categories rows where type matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = dept.type );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01903
train
v2
Schema: transactions (alias: txn)(level, name, id, salary) products(value, type, status, code) Task: Find code from transactions where a matching record exists in products with the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01904
train
v3
Schema: products (alias: prod)(value, amount, salary, status) transactions(amount, value, date, salary) Task: Retrieve salary from products with salary above the SUM(amount) of transactions rows sharing the same level. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.level = prod.level );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01905
train
v1
Schema: invoices (alias: inv)(id, type, name, date) branches(id, value, salary, amount) Task: Retrieve salary from invoices whose type is found in branches rows where type matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01906
train
v3
Schema: regions (alias: rgn)(value, status, type, id) tasks(salary, value, status, amount) Task: Retrieve code from regions with amount above the MIN(salary) of tasks rows sharing the same level. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.level = rgn.level );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01907
train
v1
Schema: staff (alias: empl)(type, level, status, date) accounts(status, name, date, amount) Task: Select id from staff where level exists in accounts for the same level. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = empl.level );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01908
train
v2
Schema: tasks (alias: tsk)(code, level, name, date) sales(amount, date, name, id) Task: Retrieve amount from tasks that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01909
train
v3
Schema: items (alias: lne)(type, value, code, salary) employees(code, type, date, id) Task: Find value from items where amount exceeds the count of salary from employees for the same code. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01910
train
v1
Schema: staff (alias: empl)(salary, name, level, type) branches(type, name, date, code) Task: Retrieve salary from staff whose level is found in branches rows where code matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01911
train
v2
Schema: transactions (alias: txn)(type, id, amount, salary) categories(type, amount, name, status) Task: Retrieve amount from transactions that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = txn.id );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01912
train
v3
Schema: sales (alias: sale)(type, code, id, value) departments(code, type, value, id) Task: Find salary from sales where amount exceeds the minimum amount from departments for the same code. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01913
train
v1
Schema: schedules (alias: schd)(status, code, amount, id) products(salary, type, value, amount) Task: Retrieve salary from schedules whose type is found in products rows where type matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01914
train
v2
Schema: branches (alias: brc)(code, value, status, type) products(value, date, level, name) Task: Find value from branches where a matching record exists in products with the same id. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = brc.id );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01915
train
v3
Schema: invoices (alias: inv)(status, id, type, date) items(type, amount, name, date) Task: Retrieve name from invoices with value above the SUM(value) of items rows sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT SUM(value) FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01916
train
v3
Schema: categories (alias: catg)(status, amount, value, date) accounts(type, id, salary, level) Task: Retrieve salary from categories with salary above the AVG(amount) of accounts rows sharing the same id. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01917
train
v2
Schema: regions (alias: rgn)(type, name, date, amount) items(value, date, type, status) Task: Retrieve amount from regions that have at least one corresponding entry in items sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01918
train
v2
Schema: items (alias: lne)(name, type, id, level) employees(value, type, id, level) Task: Retrieve amount from items that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01919
train
v1
Schema: departments (alias: dept)(amount, level, id, name) managers(level, value, name, id) Task: Retrieve code from departments whose status is found in managers rows where code matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01920
train
v3
Schema: requests (alias: ordr)(level, salary, id, value) staff(type, id, value, name) Task: Find value from requests where value exceeds the count of value from staff for the same type. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01921
train
v1
Schema: tasks (alias: tsk)(code, level, name, date) projects(code, salary, id, name) Task: Select code from tasks where type exists in projects for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01922
train
v1
Schema: categories (alias: catg)(value, name, salary, level) branches(value, id, name, salary) Task: Select value from categories where status exists in branches for the same type. SQL:
SELECT value FROM categories AS catg WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.type = catg.type );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01923
train
v1
Schema: transactions (alias: txn)(name, type, salary, level) tasks(type, date, name, status) Task: Select value from transactions where id exists in tasks for the same level. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = txn.level );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01924
train
v3
Schema: employees (alias: emp)(id, name, type, date) invoices(id, salary, level, code) Task: Retrieve name from employees with amount above the MIN(value) of invoices rows sharing the same level. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01925
train
v1
Schema: categories (alias: catg)(value, amount, salary, date) tasks(name, value, code, type) Task: Find name from categories where level appears in tasks entries with matching id. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.id = catg.id );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01926
train
v2
Schema: accounts (alias: acct)(amount, value, salary, name) projects(date, id, amount, status) Task: Find id from accounts where a matching record exists in projects with the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = acct.level );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01927
train
v2
Schema: schedules (alias: schd)(code, type, name, status) departments(code, id, name, status) Task: Find amount from schedules where a matching record exists in departments with the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01928
train
v1
Schema: departments (alias: dept)(amount, salary, id, name) requests(name, type, value, level) Task: Find salary from departments where type appears in requests entries with matching status. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01929
train
v2
Schema: regions (alias: rgn)(id, date, code, type) sales(code, salary, type, id) Task: Retrieve code from regions that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT code 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": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01930
train
v1
Schema: shipments (alias: shp)(value, code, id, date) branches(status, value, name, code) Task: Select salary from shipments where code exists in branches for the same code. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01931
train
v2
Schema: schedules (alias: schd)(date, id, value, type) branches(code, status, type, name) Task: Retrieve salary from schedules that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = schd.code );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01932
train
v1
Schema: staff (alias: empl)(level, id, type, code) requests(level, code, id, type) Task: Find value from staff where status appears in requests entries with matching status. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01933
train
v1
Schema: schedules (alias: schd)(code, id, type, name) customers(value, name, salary, type) Task: Select salary from schedules where type exists in customers for the same status. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = schd.status );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01934
train
v3
Schema: staff (alias: empl)(amount, name, level, status) transactions(value, date, id, code) Task: Find salary from staff where value exceeds the minimum value from transactions for the same code. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.code = empl.code );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01935
train
v3
Schema: accounts (alias: acct)(amount, type, status, date) requests(id, salary, code, level) Task: Find amount from accounts where amount exceeds the maximum salary from requests for the same level. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01936
train
v1
Schema: products (alias: prod)(amount, date, code, name) customers(level, status, id, value) Task: Retrieve amount from products whose code is found in customers rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01937
train
v3
Schema: orders (alias: ord)(value, status, code, amount) branches(id, date, name, salary) Task: Retrieve id from orders with value above the MAX(salary) of branches rows sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.level = ord.level );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01938
train
v2
Schema: invoices (alias: inv)(id, date, amount, status) categories(status, amount, id, code) Task: Find amount from invoices where a matching record exists in categories with the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01939
train
v1
Schema: customers (alias: cust)(level, value, type, date) items(salary, value, type, name) Task: Select id from customers where code exists in items for the same status. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01940
train
v3
Schema: staff (alias: empl)(date, salary, type, level) items(id, date, code, salary) Task: Retrieve value from staff with salary above the MAX(amount) of items rows sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01941
train
v2
Schema: categories (alias: catg)(amount, code, name, id) products(salary, id, level, name) Task: Retrieve name from categories that have at least one corresponding entry in products sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01942
train
v1
Schema: items (alias: lne)(level, id, date, status) categories(code, amount, status, name) Task: Select salary from items where id exists in categories for the same code. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01943
train
v1
Schema: projects (alias: prj)(type, code, salary, name) tasks(value, id, salary, status) Task: Retrieve name from projects whose code is found in tasks rows where id matches the outer record. SQL:
SELECT name FROM projects AS prj WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = prj.id );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01944
train
v3
Schema: branches (alias: brc)(status, type, name, value) sales(type, id, name, code) Task: Retrieve amount from branches with salary above the COUNT(salary) of sales rows sharing the same id. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.id = brc.id );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01945
train
v2
Schema: invoices (alias: inv)(id, amount, code, name) requests(amount, date, type, salary) Task: Retrieve name from invoices that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01946
train
v2
Schema: schedules (alias: schd)(status, amount, level, code) invoices(id, status, name, value) Task: Find salary from schedules where a matching record exists in invoices with the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01947
train
v2
Schema: managers (alias: mgr)(type, code, date, level) tasks(amount, type, level, date) Task: Retrieve amount from managers that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT amount 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": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01948
train
v1
Schema: managers (alias: mgr)(name, level, status, date) employees(date, salary, value, level) Task: Retrieve id from managers whose id is found in employees rows where level matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01949
train
v2
Schema: customers (alias: cust)(name, id, value, level) categories(date, type, salary, level) Task: Find value from customers where a matching record exists in categories with the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01950
train
v1
Schema: managers (alias: mgr)(value, status, id, amount) departments(code, level, id, type) Task: Select id from managers where type exists in departments for the same id. SQL:
SELECT id 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": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01951
train
v3
Schema: managers (alias: mgr)(status, date, salary, id) employees(value, amount, level, id) Task: Retrieve code from managers with salary above the MIN(amount) of employees rows sharing the same code. SQL:
SELECT code FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01952
train
v3
Schema: accounts (alias: acct)(value, status, id, name) sales(level, amount, date, type) Task: Find name from accounts where amount exceeds the average amount from sales for the same type. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.type = acct.type );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01953
train
v2
Schema: staff (alias: empl)(id, amount, value, date) products(salary, level, code, type) Task: Find value from staff where a matching record exists in products with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01954
train
v3
Schema: customers (alias: cust)(type, date, id, value) invoices(code, value, salary, status) Task: Retrieve name from customers with value above the SUM(amount) of invoices rows sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01955
train
v1
Schema: transactions (alias: txn)(date, name, amount, code) orders(code, salary, amount, status) Task: Select salary from transactions where id exists in orders for the same id. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01956
train
v2
Schema: requests (alias: ordr)(salary, date, amount, id) managers(type, salary, id, code) Task: Retrieve value from requests that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01957
train
v1
Schema: departments (alias: dept)(name, salary, date, id) products(code, amount, level, name) Task: Find amount from departments where code appears in products entries with matching id. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = dept.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01958
train
v1
Schema: managers (alias: mgr)(status, amount, name, date) staff(amount, value, date, type) Task: Select name from managers where status exists in staff for the same code. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01959
train
v1
Schema: branches (alias: brc)(date, value, type, code) items(level, type, value, amount) Task: Retrieve value from branches whose type is found in items rows where level matches the outer record. SQL:
SELECT value FROM branches AS brc WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = brc.level );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01960
train
v2
Schema: employees (alias: emp)(date, id, level, type) branches(id, salary, value, date) Task: Find value from employees where a matching record exists in branches with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01961
train
v2
Schema: requests (alias: ordr)(amount, code, level, salary) sales(level, code, amount, type) Task: Find value from requests where a matching record exists in sales with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01962
train
v3
Schema: categories (alias: catg)(salary, value, name, amount) employees(value, type, level, code) Task: Find salary from categories where salary exceeds the count of salary from employees for the same id. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01963
train
v3
Schema: regions (alias: rgn)(id, amount, type, date) shipments(amount, type, name, status) Task: Find amount from regions where value exceeds the minimum value from shipments for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01964
train
v2
Schema: schedules (alias: schd)(date, name, salary, id) sales(level, name, status, code) Task: Find code from schedules where a matching record exists in sales with the same level. SQL:
SELECT code 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": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01965
train
v3
Schema: departments (alias: dept)(code, level, value, salary) sales(name, status, value, date) Task: Find name from departments where amount exceeds the count of amount from sales for the same type. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01966
train
v1
Schema: accounts (alias: acct)(level, value, salary, amount) employees(status, code, value, level) Task: Find value from accounts where type appears in employees entries with matching type. SQL:
SELECT value FROM accounts AS acct WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01967
train
v2
Schema: managers (alias: mgr)(amount, salary, value, code) customers(status, code, level, type) Task: Find id from managers where a matching record exists in customers with the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = mgr.status );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01968
train
v2
Schema: requests (alias: ordr)(date, id, type, amount) transactions(code, name, date, salary) Task: Retrieve amount from requests that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01969
train
v2
Schema: transactions (alias: txn)(amount, value, code, type) departments(date, amount, level, name) Task: Retrieve name from transactions that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = txn.code );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01970
train
v2
Schema: schedules (alias: schd)(type, name, amount, date) items(value, code, name, type) Task: Find code from schedules where a matching record exists in items with the same status. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01971
train
v2
Schema: employees (alias: emp)(amount, status, value, name) invoices(salary, level, code, status) Task: Find amount from employees where a matching record exists in invoices with the same status. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01972
train
v2
Schema: tasks (alias: tsk)(value, type, level, status) sales(amount, date, name, status) Task: Retrieve amount from tasks that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01973
train
v2
Schema: items (alias: lne)(name, salary, level, value) departments(value, amount, status, name) 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_01974
train
v2
Schema: sales (alias: sale)(value, level, amount, status) projects(value, status, amount, code) Task: Retrieve name from sales that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01975
train
v1
Schema: tasks (alias: tsk)(status, date, id, level) managers(value, status, code, amount) Task: Retrieve name from tasks whose id is found in managers rows where code matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01976
train
v2
Schema: managers (alias: mgr)(level, type, salary, value) sales(amount, level, salary, date) Task: Retrieve name from managers that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = mgr.type );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01977
train
v3
Schema: staff (alias: empl)(name, status, type, salary) managers(id, salary, name, amount) Task: Find name from staff where value exceeds the maximum amount from managers for the same level. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01978
train
v3
Schema: products (alias: prod)(salary, id, date, code) customers(status, amount, level, code) Task: Find salary from products where salary exceeds the count of salary from customers for the same id. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT COUNT(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": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01979
train
v1
Schema: categories (alias: catg)(amount, salary, code, level) staff(date, amount, value, level) Task: Retrieve code from categories whose code is found in staff rows where code matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = catg.code );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01980
train
v3
Schema: orders (alias: ord)(status, type, code, value) products(id, status, salary, date) Task: Find code from orders where amount exceeds the count of value from products for the same code. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01981
train
v2
Schema: branches (alias: brc)(salary, level, value, status) accounts(date, type, id, code) Task: Find amount from branches where a matching record exists in accounts with the same id. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = brc.id );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01982
train
v1
Schema: accounts (alias: acct)(value, amount, type, id) invoices(type, salary, name, status) Task: Find code from accounts where status appears in invoices entries with matching type. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01983
train
v3
Schema: accounts (alias: acct)(level, salary, name, value) managers(type, salary, status, level) Task: Retrieve amount from accounts with amount above the SUM(value) of managers rows sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01984
train
v3
Schema: sales (alias: sale)(name, id, date, value) categories(date, salary, level, code) Task: Retrieve value from sales with amount above the SUM(salary) of categories rows sharing the same id. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.id = sale.id );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01985
train
v1
Schema: customers (alias: cust)(name, level, status, value) invoices(status, amount, id, level) Task: Find salary from customers where type appears in invoices entries with matching status. SQL:
SELECT salary FROM customers AS cust WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01986
train
v3
Schema: regions (alias: rgn)(status, type, code, salary) items(name, value, type, level) Task: Retrieve amount from regions with value above the AVG(salary) of items rows sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = rgn.status );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01987
train
v3
Schema: staff (alias: empl)(code, date, id, level) branches(name, code, date, salary) Task: Find id from staff where amount exceeds the count of value from branches for the same type. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.type = empl.type );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01988
train
v2
Schema: branches (alias: brc)(amount, status, date, name) employees(code, level, amount, name) Task: Find salary from branches where a matching record exists in employees with 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_01989
train
v3
Schema: customers (alias: cust)(id, date, value, salary) items(code, salary, amount, id) Task: Retrieve salary from customers with value above the MIN(value) of items rows sharing the same id. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT MIN(value) FROM items AS lne WHERE lne.id = cust.id );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01990
train
v1
Schema: transactions (alias: txn)(id, name, type, salary) managers(type, date, salary, name) Task: Retrieve amount from transactions whose code is found in managers rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01991
train
v2
Schema: branches (alias: brc)(amount, type, id, name) regions(date, id, level, type) Task: Retrieve name from branches that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = brc.status );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "name", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01992
train
v1
Schema: shipments (alias: shp)(salary, type, date, name) orders(code, date, type, salary) Task: Select amount from shipments where code exists in orders for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01993
train
v3
Schema: departments (alias: dept)(level, status, code, id) tasks(id, salary, status, value) Task: Find name from departments where salary exceeds the total amount from tasks for the same level. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.level = dept.level );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01994
train
v2
Schema: shipments (alias: shp)(name, id, type, amount) tasks(name, code, amount, value) Task: Retrieve id from shipments that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = shp.type );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01995
train
v3
Schema: shipments (alias: shp)(name, date, amount, value) invoices(level, code, id, salary) Task: Find id from shipments where value exceeds the minimum amount from invoices for the same status. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = shp.status );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01996
train
v1
Schema: categories (alias: catg)(code, status, type, amount) items(type, code, name, value) Task: Find code from categories where id appears in items entries with matching level. SQL:
SELECT code FROM categories AS catg WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01997
train
v1
Schema: requests (alias: ordr)(level, value, salary, code) employees(type, code, date, salary) Task: Retrieve id from requests whose id is found in employees rows where status matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01998
train
v1
Schema: managers (alias: mgr)(amount, type, status, level) sales(salary, amount, id, code) Task: Retrieve salary from managers whose status is found in sales rows where id matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01999
train