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: tasks (alias: tsk)(status, id, level, name) categories(name, code, status, level) Task: Select value from tasks where status exists in categories for the same id. SQL:
SELECT value FROM tasks AS tsk WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18000
train
v1
Schema: schedules (alias: schd)(value, amount, name, code) staff(id, salary, date, amount) Task: Select code from schedules where status exists in staff for the same id. SQL:
SELECT code FROM schedules AS schd WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18001
train
v1
Schema: items (alias: lne)(code, type, id, name) staff(level, date, type, code) Task: Find amount from items where id appears in staff entries with matching type. SQL:
SELECT amount FROM items AS lne WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18002
train
v1
Schema: branches (alias: brc)(status, id, level, name) customers(name, id, amount, value) Task: Select id from branches where code exists in customers for the same type. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18003
train
v3
Schema: schedules (alias: schd)(amount, type, status, code) sales(value, status, name, salary) Task: Retrieve name from schedules with salary above the COUNT(salary) of sales rows sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18004
train
v2
Schema: sales (alias: sale)(salary, name, status, date) branches(salary, id, type, level) Task: Retrieve name from sales that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = sale.code );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18005
train
v1
Schema: orders (alias: ord)(code, status, type, value) tasks(status, salary, id, code) Task: Find name from orders where type appears in tasks entries with matching status. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18006
train
v1
Schema: transactions (alias: txn)(level, salary, value, date) categories(level, value, name, date) Task: Select name from transactions where level exists in categories for the same level. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18007
train
v1
Schema: products (alias: prod)(level, type, date, id) employees(name, value, id, amount) Task: Find salary from products where type appears in employees entries with matching type. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18008
train
v3
Schema: tasks (alias: tsk)(amount, id, value, level) staff(id, salary, code, type) Task: Retrieve id from tasks with salary above the COUNT(amount) of staff rows sharing the same code. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18009
train
v3
Schema: transactions (alias: txn)(id, date, name, level) staff(level, amount, status, value) Task: Retrieve salary from transactions with salary above the SUM(salary) of staff rows sharing the same type. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18010
train
v2
Schema: transactions (alias: txn)(code, amount, value, level) invoices(amount, code, id, status) Task: Retrieve value from transactions that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18011
train
v1
Schema: staff (alias: empl)(salary, id, code, level) schedules(code, id, date, salary) Task: Retrieve amount from staff whose code is found in schedules rows where level matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = empl.level );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18012
train
v3
Schema: requests (alias: ordr)(value, status, id, amount) managers(value, id, code, salary) Task: Find value from requests where value exceeds the count of salary from managers for the same level. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18013
train
v3
Schema: managers (alias: mgr)(amount, id, type, code) transactions(id, date, value, amount) Task: Retrieve amount from managers with salary above the SUM(salary) of transactions rows sharing the same status. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18014
train
v2
Schema: projects (alias: prj)(name, date, code, level) categories(code, date, amount, type) Task: Find name from projects where a matching record exists in categories with the same type. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18015
train
v3
Schema: items (alias: lne)(id, amount, type, salary) transactions(name, salary, type, date) Task: Retrieve amount from items with salary above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18016
train
v2
Schema: requests (alias: ordr)(id, status, salary, code) items(type, date, name, amount) Task: Find amount from requests where a matching record exists in items with the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = ordr.type );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18017
train
v1
Schema: transactions (alias: txn)(code, level, status, value) shipments(status, level, name, date) Task: Select name from transactions where id exists in shipments for the same level. SQL:
SELECT name FROM transactions AS txn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18018
train
v1
Schema: invoices (alias: inv)(amount, code, type, value) shipments(value, amount, code, type) Task: Select salary from invoices where type exists in shipments for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18019
train
v2
Schema: staff (alias: empl)(status, name, id, type) managers(status, amount, value, name) Task: Find code from staff where a matching record exists in managers with the same type. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18020
train
v1
Schema: tasks (alias: tsk)(level, id, type, status) projects(type, amount, date, code) Task: Find name from tasks where id appears in projects entries with matching code. SQL:
SELECT name FROM tasks AS tsk WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18021
train
v3
Schema: categories (alias: catg)(amount, salary, name, status) departments(value, salary, name, status) Task: Find name from categories where amount exceeds the count of value from departments for the same id. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18022
train
v2
Schema: invoices (alias: inv)(amount, type, name, value) shipments(amount, date, code, id) Task: Retrieve amount from invoices that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18023
train
v2
Schema: departments (alias: dept)(level, value, date, type) schedules(salary, date, id, level) Task: Find salary from departments where a matching record exists in schedules with the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18024
train
v1
Schema: categories (alias: catg)(amount, name, status, salary) projects(value, date, status, type) Task: Retrieve salary from categories whose status is found in projects rows where type matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.type = catg.type );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18025
train
v2
Schema: staff (alias: empl)(code, status, date, level) branches(value, date, salary, type) Task: Retrieve name from staff that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "name", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18026
train
v3
Schema: managers (alias: mgr)(value, date, salary, name) transactions(date, name, code, level) Task: Find value from managers where value exceeds the count of salary from transactions for the same level. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18027
train
v2
Schema: categories (alias: catg)(amount, type, name, status) tasks(salary, status, code, amount) Task: Find value from categories where a matching record exists in tasks with the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = catg.type );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18028
train
v2
Schema: regions (alias: rgn)(salary, name, status, code) tasks(code, level, date, id) Task: Retrieve salary from regions that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18029
train
v1
Schema: staff (alias: empl)(amount, date, value, salary) departments(value, salary, date, code) Task: Select amount from staff where id exists in departments for the same status. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18030
train
v1
Schema: requests (alias: ordr)(value, type, id, level) transactions(status, value, salary, id) Task: Select id from requests where level exists in transactions for the same code. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18031
train
v1
Schema: transactions (alias: txn)(id, amount, type, date) regions(name, type, value, id) Task: Find value from transactions where code appears in regions entries with matching type. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18032
train
v3
Schema: managers (alias: mgr)(value, type, name, id) staff(salary, type, status, id) Task: Find salary from managers where salary exceeds the count of value from staff for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18033
train
v3
Schema: categories (alias: catg)(salary, name, type, date) branches(amount, date, value, salary) Task: Retrieve salary from categories with value above the AVG(value) of branches rows sharing the same id. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM branches AS brc WHERE brc.id = catg.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18034
train
v2
Schema: projects (alias: prj)(id, value, type, level) categories(id, level, name, amount) Task: Retrieve code from projects that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = prj.id );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18035
train
v1
Schema: orders (alias: ord)(name, type, amount, status) sales(name, amount, code, type) Task: Find amount from orders where id appears in sales entries with matching code. SQL:
SELECT amount FROM orders AS ord WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = ord.code );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18036
train
v3
Schema: invoices (alias: inv)(name, amount, id, level) schedules(type, level, salary, name) Task: Find name from invoices where amount exceeds the minimum value from schedules for the same status. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18037
train
v1
Schema: sales (alias: sale)(name, code, status, amount) products(status, code, type, value) Task: Retrieve value from sales whose level is found in products rows where status matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = sale.status );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18038
train
v3
Schema: products (alias: prod)(status, code, date, salary) employees(status, amount, salary, type) Task: Find value from products where value exceeds the count of value from employees for the same level. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.level = prod.level );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18039
train
v2
Schema: employees (alias: emp)(level, status, value, date) branches(level, amount, name, code) Task: Find code from employees where a matching record exists in branches with the same level. SQL:
SELECT code 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": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18040
train
v1
Schema: branches (alias: brc)(amount, status, value, name) regions(date, name, code, type) Task: Retrieve amount from branches whose level is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = brc.status );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18041
train
v1
Schema: accounts (alias: acct)(amount, code, date, salary) customers(status, type, amount, salary) Task: Retrieve salary from accounts whose code is found in customers rows where status matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18042
train
v1
Schema: regions (alias: rgn)(code, id, value, status) customers(value, status, name, date) Task: Retrieve code from regions whose id is found in customers rows where type matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18043
train
v2
Schema: employees (alias: emp)(salary, amount, date, type) transactions(date, salary, id, code) Task: Retrieve id from employees that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = emp.status );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18044
train
v2
Schema: orders (alias: ord)(type, id, code, name) requests(code, value, date, name) Task: Retrieve value from orders that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18045
train
v3
Schema: employees (alias: emp)(code, name, type, id) invoices(id, type, value, level) Task: Find value from employees where value exceeds the average value from invoices for the same status. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18046
train
v3
Schema: managers (alias: mgr)(type, amount, level, value) products(id, level, value, code) Task: Find salary from managers where salary exceeds the count of value from products for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18047
train
v3
Schema: products (alias: prod)(code, id, value, date) schedules(salary, value, amount, type) Task: Retrieve id from products with value above the MIN(value) of schedules rows sharing the same type. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18048
train
v2
Schema: accounts (alias: acct)(id, amount, code, date) customers(salary, level, name, amount) Task: Retrieve amount from accounts that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18049
train
v3
Schema: schedules (alias: schd)(level, date, amount, id) transactions(level, name, id, type) Task: Retrieve value from schedules with salary above the SUM(salary) of transactions rows sharing the same status. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18050
train
v2
Schema: orders (alias: ord)(amount, date, level, status) projects(type, name, date, amount) Task: Retrieve code from orders that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = ord.status );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18051
train
v3
Schema: orders (alias: ord)(level, amount, value, type) items(type, code, name, status) Task: Find salary from orders where value exceeds the maximum salary from items for the same status. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT MAX(salary) FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18052
train
v2
Schema: sales (alias: sale)(level, code, amount, value) projects(amount, code, value, status) Task: Find name from sales where a matching record exists in projects with the same status. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18053
train
v1
Schema: employees (alias: emp)(code, salary, date, value) invoices(salary, code, value, amount) Task: Retrieve code from employees whose code is found in invoices rows where level matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18054
train
v3
Schema: shipments (alias: shp)(date, value, salary, type) requests(salary, code, id, level) Task: Find code from shipments where value exceeds the average value from requests for the same code. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18055
train
v3
Schema: schedules (alias: schd)(amount, name, id, status) transactions(salary, name, type, id) Task: Find code from schedules where value exceeds the total value from transactions for the same status. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18056
train
v3
Schema: departments (alias: dept)(name, type, amount, level) branches(value, salary, type, amount) Task: Retrieve amount from departments with salary above the MIN(salary) of branches rows sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18057
train
v2
Schema: departments (alias: dept)(status, date, type, amount) tasks(id, code, value, type) Task: Find id from departments where a matching record exists in tasks with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = dept.status );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18058
train
v1
Schema: departments (alias: dept)(salary, amount, value, code) branches(value, date, status, level) Task: Retrieve amount from departments whose status is found in branches rows where level matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18059
train
v2
Schema: shipments (alias: shp)(level, salary, code, amount) requests(salary, status, id, date) Task: Find code from shipments where a matching record exists in requests with the same code. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18060
train
v1
Schema: departments (alias: dept)(code, status, salary, type) products(id, value, salary, date) Task: Find value from departments where status appears in products entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = dept.code );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18061
train
v1
Schema: orders (alias: ord)(date, value, code, status) shipments(date, type, status, value) Task: Select value from orders where level exists in shipments for the same code. SQL:
SELECT value FROM orders AS ord WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = ord.code );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18062
train
v1
Schema: accounts (alias: acct)(date, name, id, code) requests(id, type, date, salary) Task: Select id from accounts where code exists in requests for the same code. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18063
train
v2
Schema: branches (alias: brc)(status, date, name, amount) items(type, id, level, status) Task: Find id from branches where a matching record exists in items with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18064
train
v3
Schema: shipments (alias: shp)(salary, type, code, date) tasks(value, level, amount, type) Task: Find id from shipments where value exceeds the count of salary from tasks for the same type. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT COUNT(salary) FROM tasks AS tsk WHERE tsk.type = shp.type );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18065
train
v3
Schema: employees (alias: emp)(id, value, level, amount) shipments(level, status, id, name) Task: Find salary from employees where amount exceeds the total value from shipments for the same code. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18066
train
v1
Schema: shipments (alias: shp)(date, amount, level, type) regions(level, id, salary, value) Task: Retrieve name from shipments whose level is found in regions rows where status matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18067
train
v1
Schema: managers (alias: mgr)(type, status, name, value) sales(name, code, date, value) Task: Retrieve id from managers whose status is found in sales rows where code matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18068
train
v2
Schema: staff (alias: empl)(id, name, level, date) requests(value, name, type, amount) Task: Find salary from staff where a matching record exists in requests with the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18069
train
v1
Schema: orders (alias: ord)(value, salary, status, type) tasks(salary, amount, id, status) Task: Retrieve value from orders whose id is found in tasks rows where code matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = ord.code );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18070
train
v2
Schema: customers (alias: cust)(value, level, name, type) invoices(amount, salary, id, name) Task: Find name from customers where a matching record exists in invoices with the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18071
train
v2
Schema: sales (alias: sale)(status, amount, date, level) items(code, status, date, id) Task: Retrieve id from sales that have at least one corresponding entry in items sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18072
train
v2
Schema: items (alias: lne)(id, type, date, level) categories(salary, id, name, value) Task: Retrieve value from items that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = lne.status );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18073
train
v1
Schema: transactions (alias: txn)(level, code, value, id) accounts(code, amount, date, name) Task: Find name from transactions where code appears in accounts entries with matching status. SQL:
SELECT name FROM transactions AS txn WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = txn.status );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18074
train
v1
Schema: regions (alias: rgn)(level, status, amount, id) shipments(status, amount, code, level) Task: Find value from regions where level appears in shipments entries with matching level. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18075
train
v2
Schema: schedules (alias: schd)(name, code, level, type) orders(name, code, id, value) Task: Find code from schedules where a matching record exists in orders with the same type. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18076
train
v2
Schema: regions (alias: rgn)(value, status, date, code) transactions(value, type, date, id) Task: Retrieve code from regions that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18077
train
v2
Schema: managers (alias: mgr)(level, value, status, salary) employees(date, status, id, value) Task: Find value from managers where a matching record exists in employees with the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18078
train
v2
Schema: regions (alias: rgn)(value, salary, date, name) items(date, type, code, name) Task: Find id from regions where a matching record exists in items with the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = rgn.level );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18079
train
v1
Schema: accounts (alias: acct)(id, code, amount, type) shipments(salary, type, id, level) Task: Select id from accounts where type exists in shipments for the same status. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18080
train
v1
Schema: staff (alias: empl)(value, name, amount, id) accounts(salary, status, amount, date) Task: Retrieve value from staff whose level is found in accounts rows where level matches the outer record. SQL:
SELECT value 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": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18081
train
v1
Schema: staff (alias: empl)(date, level, amount, name) invoices(status, salary, type, amount) Task: Select id from staff where level exists in invoices for the same level. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = empl.level );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18082
train
v2
Schema: departments (alias: dept)(name, salary, date, code) accounts(amount, value, type, date) Task: Retrieve value from departments that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18083
train
v2
Schema: regions (alias: rgn)(name, salary, code, status) items(amount, salary, date, status) Task: Find id from regions where a matching record exists in items with the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = rgn.level );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18084
train
v1
Schema: invoices (alias: inv)(code, type, salary, id) employees(value, status, type, id) Task: Find name from invoices where level appears in employees entries with matching status. SQL:
SELECT name FROM invoices AS inv WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18085
train
v2
Schema: sales (alias: sale)(salary, code, id, amount) accounts(date, status, id, value) Task: Retrieve name from sales that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18086
train
v3
Schema: items (alias: lne)(id, type, name, value) employees(name, id, code, value) Task: Retrieve name from items with amount above the MAX(value) of employees rows sharing the same id. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM employees AS emp WHERE emp.id = lne.id );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18087
train
v3
Schema: requests (alias: ordr)(status, id, salary, level) tasks(code, level, amount, name) Task: Retrieve id from requests with value above the MAX(value) of tasks rows sharing the same code. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.code = ordr.code );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18088
train
v2
Schema: managers (alias: mgr)(code, status, type, date) tasks(type, date, amount, code) Task: Retrieve salary from managers that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18089
train
v2
Schema: shipments (alias: shp)(type, salary, status, name) sales(type, code, date, value) Task: Retrieve code from shipments that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = shp.level );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18090
train
v1
Schema: products (alias: prod)(status, level, type, value) requests(type, id, name, status) Task: Find value from products where level appears in requests entries with matching status. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18091
train
v1
Schema: projects (alias: prj)(status, id, date, type) products(name, amount, type, status) Task: Select value from projects where code exists in products for the same code. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = prj.code );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18092
train
v2
Schema: schedules (alias: schd)(level, date, code, salary) requests(type, level, status, name) Task: Find value from schedules where a matching record exists in requests with the same level. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18093
train
v2
Schema: regions (alias: rgn)(salary, status, amount, type) projects(date, salary, value, type) Task: Find id from regions where a matching record exists in projects with the same id. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = rgn.id );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18094
train
v2
Schema: staff (alias: empl)(type, amount, code, status) managers(amount, code, value, id) Task: Find id from staff where a matching record exists in managers with the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18095
train
v1
Schema: items (alias: lne)(code, name, type, salary) tasks(id, level, name, status) Task: Retrieve salary from items whose code is found in tasks rows where status matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.status = lne.status );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18096
train
v2
Schema: orders (alias: ord)(value, date, amount, level) staff(type, amount, value, level) Task: Retrieve code from orders that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = ord.level );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18097
train
v2
Schema: schedules (alias: schd)(type, salary, amount, level) sales(code, value, type, name) Task: Retrieve salary from schedules that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18098
train
v1
Schema: accounts (alias: acct)(type, name, amount, id) schedules(date, code, id, amount) Task: Select amount from accounts where status exists in schedules for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18099
train