variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: orders (alias: ord)(code, id, status, date) departments(code, salary, date, value) Task: Retrieve value from orders that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = ord.type );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12000
train
v2
Schema: products (alias: prod)(name, amount, id, code) sales(id, value, code, date) Task: Retrieve name from products that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12001
train
v2
Schema: schedules (alias: schd)(status, salary, amount, name) branches(value, type, amount, name) Task: Find name from schedules where a matching record exists in branches with the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = schd.status );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12002
train
v3
Schema: products (alias: prod)(code, type, level, value) managers(status, amount, type, level) Task: Find salary from products where value exceeds the average value from managers for the same type. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12003
train
v1
Schema: staff (alias: empl)(value, date, salary, status) requests(amount, name, date, value) Task: Retrieve salary from staff whose code is found in requests rows where id matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12004
train
v2
Schema: categories (alias: catg)(date, id, amount, status) customers(code, id, date, level) Task: Find id from categories where a matching record exists in customers with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = catg.id );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12005
train
v3
Schema: invoices (alias: inv)(level, status, id, type) sales(type, code, id, amount) Task: Retrieve amount from invoices with value above the COUNT(salary) of sales rows sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12006
train
v3
Schema: accounts (alias: acct)(value, date, status, level) projects(status, code, date, id) Task: Find value from accounts where amount exceeds the total value from projects for the same code. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT SUM(value) FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12007
train
v2
Schema: sales (alias: sale)(type, salary, amount, level) accounts(name, value, type, salary) Task: Retrieve salary from sales that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12008
train
v2
Schema: tasks (alias: tsk)(value, status, name, code) transactions(amount, type, date, code) Task: Find code from tasks where a matching record exists in transactions with the same id. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12009
train
v1
Schema: employees (alias: emp)(id, status, code, type) projects(date, status, name, code) Task: Select amount from employees where status exists in projects for the same code. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.code = emp.code );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12010
train
v3
Schema: invoices (alias: inv)(name, status, salary, value) categories(type, salary, code, id) Task: Retrieve name from invoices with salary above the SUM(salary) of categories rows sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12011
train
v3
Schema: orders (alias: ord)(level, salary, id, name) managers(amount, level, salary, date) Task: Retrieve amount from orders with value above the AVG(value) of managers rows sharing the same id. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12012
train
v2
Schema: requests (alias: ordr)(value, date, code, type) invoices(amount, level, salary, id) Task: Find id from requests where a matching record exists in invoices with the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12013
train
v2
Schema: regions (alias: rgn)(value, date, amount, name) schedules(level, type, code, name) Task: Find value from regions where a matching record exists in schedules with the same status. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12014
train
v2
Schema: orders (alias: ord)(name, date, value, amount) invoices(level, type, status, value) Task: Find name from orders where a matching record exists in invoices with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12015
train
v1
Schema: transactions (alias: txn)(amount, value, level, code) staff(status, level, name, date) Task: Retrieve id from transactions whose level is found in staff rows where type matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12016
train
v2
Schema: branches (alias: brc)(salary, level, amount, date) tasks(id, type, value, status) Task: Find code from branches where a matching record exists in tasks with the same id. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = brc.id );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12017
train
v2
Schema: departments (alias: dept)(code, date, value, status) orders(type, amount, id, value) Task: Find id from departments where a matching record exists in orders with the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12018
train
v2
Schema: products (alias: prod)(value, level, date, name) accounts(name, level, type, code) Task: Find id from products where a matching record exists in accounts with the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12019
train
v1
Schema: sales (alias: sale)(id, date, level, type) regions(date, value, status, id) Task: Retrieve value from sales whose level is found in regions rows where type matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.type = sale.type );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12020
train
v3
Schema: shipments (alias: shp)(id, name, status, level) categories(id, value, name, salary) Task: Retrieve id from shipments with value above the AVG(amount) of categories rows sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12021
train
v1
Schema: staff (alias: empl)(value, amount, name, date) branches(salary, status, type, amount) Task: Retrieve amount from staff whose id is found in branches rows where code matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12022
train
v3
Schema: projects (alias: prj)(date, id, level, status) customers(level, salary, amount, value) Task: Find amount from projects where amount exceeds the count of salary from customers for the same status. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.status = prj.status );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12023
train
v2
Schema: managers (alias: mgr)(id, amount, salary, level) shipments(value, type, date, amount) Task: Find code from managers where a matching record exists in shipments with the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12024
train
v3
Schema: staff (alias: empl)(salary, value, amount, name) shipments(type, name, status, amount) Task: Find name from staff where salary exceeds the count of value from shipments for the same status. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12025
train
v1
Schema: requests (alias: ordr)(level, type, status, code) managers(date, amount, salary, status) Task: Select id from requests where status exists in managers for the same level. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12026
train
v3
Schema: tasks (alias: tsk)(value, code, salary, type) employees(id, code, salary, date) Task: Retrieve salary from tasks with salary above the MIN(salary) of employees rows sharing the same status. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12027
train
v1
Schema: products (alias: prod)(status, date, name, salary) tasks(name, amount, salary, type) Task: Retrieve name from products whose status is found in tasks rows where type matches the outer record. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12028
train
v3
Schema: sales (alias: sale)(amount, code, type, salary) branches(id, value, status, type) Task: Find amount from sales where value exceeds the count of salary from branches for the same id. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.id = sale.id );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12029
train
v2
Schema: employees (alias: emp)(name, id, date, type) managers(level, name, code, id) Task: Retrieve salary from employees that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12030
train
v1
Schema: products (alias: prod)(date, status, level, amount) orders(salary, type, name, status) Task: Retrieve id from products whose status is found in orders rows where code matches the outer record. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12031
train
v1
Schema: branches (alias: brc)(status, name, id, code) departments(value, salary, type, id) Task: Select value from branches where code exists in departments for the same id. SQL:
SELECT value FROM branches AS brc WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = brc.id );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12032
train
v3
Schema: projects (alias: prj)(date, salary, code, value) transactions(level, date, salary, id) Task: Find salary from projects where salary exceeds the average value from transactions for the same status. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.status = prj.status );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12033
train
v3
Schema: invoices (alias: inv)(amount, id, value, level) items(level, date, name, type) Task: Retrieve salary from invoices with salary above the MIN(value) of items rows sharing the same code. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12034
train
v3
Schema: employees (alias: emp)(type, code, value, salary) tasks(id, status, date, value) Task: Find code from employees where amount exceeds the count of amount from tasks for the same level. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.level = emp.level );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12035
train
v3
Schema: departments (alias: dept)(value, id, amount, code) sales(value, date, id, status) Task: Retrieve id from departments with salary above the MIN(value) of sales rows sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM sales AS sale WHERE sale.status = dept.status );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12036
train
v2
Schema: projects (alias: prj)(code, level, name, date) categories(value, code, name, type) Task: Find id from projects where a matching record exists in categories with the same code. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prj.code );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12037
train
v2
Schema: schedules (alias: schd)(date, salary, level, type) regions(id, status, name, code) Task: Retrieve id from schedules that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12038
train
v1
Schema: tasks (alias: tsk)(name, amount, salary, value) invoices(code, date, salary, level) Task: Find value from tasks where code appears in invoices entries with matching id. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12039
train
v2
Schema: shipments (alias: shp)(date, salary, value, type) departments(status, date, level, salary) Task: Find code from shipments where a matching record exists in departments with the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = shp.status );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12040
train
v3
Schema: requests (alias: ordr)(type, salary, value, name) employees(code, amount, status, level) Task: Find salary from requests where value exceeds the maximum salary from employees for the same code. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12041
train
v1
Schema: products (alias: prod)(id, code, status, salary) staff(salary, amount, code, id) Task: Select salary from products where status exists in staff for the same type. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12042
train
v3
Schema: shipments (alias: shp)(name, date, salary, type) invoices(salary, value, name, id) Task: Retrieve salary from shipments with value above the COUNT(amount) of invoices rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12043
train
v2
Schema: categories (alias: catg)(name, date, type, level) departments(level, name, id, amount) Task: Retrieve id from categories that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = catg.type );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12044
train
v3
Schema: accounts (alias: acct)(status, code, id, amount) shipments(code, name, value, amount) Task: Find id from accounts where amount exceeds the maximum amount from shipments for the same code. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12045
train
v1
Schema: regions (alias: rgn)(name, status, value, id) products(type, date, id, salary) Task: Find salary from regions where id appears in products entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12046
train
v2
Schema: customers (alias: cust)(id, date, code, value) items(value, amount, date, salary) Task: Retrieve code from customers that have at least one corresponding entry in items sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12047
train
v3
Schema: departments (alias: dept)(amount, status, code, value) transactions(code, status, type, date) Task: Retrieve value from departments with value above the AVG(value) of transactions rows sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12048
train
v2
Schema: employees (alias: emp)(code, type, level, salary) tasks(id, salary, level, type) Task: Retrieve code from employees that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = emp.code );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12049
train
v2
Schema: regions (alias: rgn)(salary, name, code, level) requests(value, code, amount, type) Task: Retrieve value from regions that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12050
train
v3
Schema: requests (alias: ordr)(value, date, type, code) regions(level, value, date, status) Task: Retrieve amount from requests with value above the SUM(salary) of regions rows sharing the same level. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12051
train
v1
Schema: transactions (alias: txn)(id, date, value, name) departments(date, salary, code, status) Task: Find code from transactions where type appears in departments entries with matching id. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12052
train
v2
Schema: staff (alias: empl)(status, id, salary, name) requests(id, date, level, name) Task: Find code from staff where a matching record exists in requests with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12053
train
v3
Schema: regions (alias: rgn)(id, value, type, date) tasks(name, amount, status, level) Task: Find salary from regions where amount exceeds the minimum salary from tasks for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12054
train
v2
Schema: schedules (alias: schd)(amount, name, date, salary) departments(id, value, code, status) Task: Retrieve value from schedules that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = schd.level );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12055
train
v2
Schema: transactions (alias: txn)(name, salary, code, status) staff(code, value, id, status) Task: Retrieve amount from transactions that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12056
train
v2
Schema: products (alias: prod)(type, salary, amount, level) branches(code, id, status, salary) Task: Find salary from products where a matching record exists in branches with the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12057
train
v1
Schema: products (alias: prod)(level, salary, amount, type) items(code, status, date, type) Task: Select value from products where id exists in items for the same level. SQL:
SELECT value FROM products AS prod WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = prod.level );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12058
train
v3
Schema: accounts (alias: acct)(name, id, value, type) shipments(level, value, amount, code) Task: Find salary from accounts where amount exceeds the count of amount from shipments for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12059
train
v3
Schema: requests (alias: ordr)(status, salary, type, amount) products(type, code, date, id) Task: Find id from requests where amount exceeds the minimum value from products for the same level. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12060
train
v2
Schema: projects (alias: prj)(amount, date, level, type) orders(id, code, type, value) Task: Find value from projects where a matching record exists in orders with the same id. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = prj.id );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12061
train
v3
Schema: products (alias: prod)(salary, level, date, amount) sales(status, code, name, salary) Task: Find id from products where salary exceeds the average salary from sales for the same id. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12062
train
v1
Schema: managers (alias: mgr)(name, value, status, date) categories(level, type, date, value) Task: Find salary from managers where code appears in categories entries with matching level. SQL:
SELECT salary FROM managers AS mgr WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12063
train
v2
Schema: transactions (alias: txn)(amount, date, level, salary) staff(status, type, id, level) Task: Retrieve salary from transactions that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12064
train
v2
Schema: schedules (alias: schd)(salary, status, name, level) branches(type, status, name, amount) Task: Find salary from schedules where a matching record exists in branches with the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12065
train
v1
Schema: accounts (alias: acct)(name, amount, level, salary) shipments(date, level, code, id) Task: Find value from accounts where id appears in shipments entries with matching id. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12066
train
v3
Schema: regions (alias: rgn)(code, type, date, salary) orders(code, salary, value, id) Task: Find salary from regions where amount exceeds the average value from orders for the same status. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT AVG(value) FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12067
train
v2
Schema: accounts (alias: acct)(type, level, id, date) staff(amount, status, salary, type) Task: Retrieve value from accounts that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12068
train
v2
Schema: departments (alias: dept)(status, name, date, type) projects(salary, type, date, id) Task: Find name from departments where a matching record exists in projects with the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12069
train
v2
Schema: invoices (alias: inv)(amount, code, value, name) categories(level, value, type, salary) Task: Find name from invoices where a matching record exists in categories with the same level. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12070
train
v2
Schema: managers (alias: mgr)(date, status, amount, name) accounts(level, type, value, name) Task: Retrieve code from managers that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12071
train
v1
Schema: items (alias: lne)(level, status, value, salary) shipments(level, type, salary, id) Task: Retrieve name from items whose id is found in shipments rows where level matches the outer record. SQL:
SELECT name FROM items AS lne WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12072
train
v3
Schema: schedules (alias: schd)(code, name, level, id) orders(salary, status, value, amount) Task: Find amount from schedules where amount exceeds the total value from orders for the same id. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12073
train
v2
Schema: categories (alias: catg)(value, type, name, date) shipments(status, name, level, type) Task: Retrieve value from categories that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12074
train
v1
Schema: projects (alias: prj)(id, type, status, level) tasks(code, status, date, level) Task: Find id from projects where level appears in tasks entries with matching status. SQL:
SELECT id FROM projects AS prj WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12075
train
v2
Schema: items (alias: lne)(level, id, type, status) accounts(amount, code, id, value) Task: Find name from items where a matching record exists in accounts with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12076
train
v3
Schema: accounts (alias: acct)(status, level, date, value) shipments(date, code, salary, amount) Task: Find amount from accounts where salary exceeds the average amount from shipments for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12077
train
v3
Schema: managers (alias: mgr)(value, id, type, amount) categories(value, amount, name, level) Task: Find amount from managers where amount exceeds the count of value from categories for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12078
train
v1
Schema: products (alias: prod)(name, id, salary, code) staff(id, salary, type, amount) Task: Retrieve salary from products whose type is found in staff rows where type matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12079
train
v3
Schema: requests (alias: ordr)(value, code, date, level) products(code, date, name, id) Task: Find value from requests where salary exceeds the total amount from products for the same level. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT SUM(amount) FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12080
train
v2
Schema: customers (alias: cust)(date, level, name, value) transactions(type, code, date, status) Task: Retrieve code from customers that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12081
train
v1
Schema: schedules (alias: schd)(type, amount, date, value) requests(level, id, date, name) Task: Select name from schedules where id exists in requests for the same id. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12082
train
v2
Schema: accounts (alias: acct)(code, value, level, status) categories(id, salary, level, value) Task: Retrieve amount from accounts that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12083
train
v1
Schema: projects (alias: prj)(id, code, type, value) departments(status, salary, name, value) Task: Select amount from projects where level exists in departments for the same status. SQL:
SELECT amount FROM projects AS prj WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12084
train
v1
Schema: departments (alias: dept)(amount, code, salary, name) employees(amount, date, code, id) Task: Select amount from departments where level exists in employees for the same code. SQL:
SELECT amount FROM departments AS dept WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12085
train
v2
Schema: orders (alias: ord)(status, salary, level, amount) regions(code, status, level, type) Task: Find salary from orders where a matching record exists in regions with the same level. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ord.level );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12086
train
v2
Schema: employees (alias: emp)(code, level, id, name) departments(value, code, level, date) Task: Retrieve id from employees that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12087
train
v1
Schema: regions (alias: rgn)(date, amount, value, status) departments(amount, id, status, level) Task: Select id from regions where code exists in departments for the same type. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = rgn.type );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12088
train
v2
Schema: products (alias: prod)(amount, name, status, date) employees(date, code, id, amount) Task: Find value from products where a matching record exists in employees with the same type. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12089
train
v1
Schema: regions (alias: rgn)(name, date, salary, code) orders(code, value, date, id) Task: Find code from regions where level appears in orders entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12090
train
v2
Schema: categories (alias: catg)(status, type, id, name) requests(name, value, status, id) Task: Find salary from categories where a matching record exists in requests with the same level. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = catg.level );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "salary", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12091
train
v3
Schema: invoices (alias: inv)(id, value, amount, name) projects(type, name, level, value) Task: Find salary from invoices where value exceeds the count of value from projects for the same status. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT COUNT(value) FROM projects AS prj WHERE prj.status = inv.status );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12092
train
v1
Schema: tasks (alias: tsk)(level, name, code, status) shipments(status, code, amount, date) Task: Select name from tasks where level exists in shipments for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12093
train
v3
Schema: shipments (alias: shp)(id, level, date, amount) requests(status, code, id, name) Task: Retrieve code from shipments with value above the MAX(value) of requests rows sharing the same code. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT MAX(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": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12094
train
v2
Schema: customers (alias: cust)(id, status, date, code) invoices(salary, amount, level, name) Task: Find id from customers where a matching record exists in invoices with the same status. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12095
train
v2
Schema: schedules (alias: schd)(date, salary, status, type) shipments(date, level, status, salary) Task: Retrieve salary from schedules that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12096
train
v3
Schema: sales (alias: sale)(value, name, status, salary) employees(level, type, name, code) Task: Find value from sales where salary exceeds the total salary from employees for the same id. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12097
train
v3
Schema: transactions (alias: txn)(status, name, amount, level) orders(salary, id, amount, type) Task: Find value from transactions where value exceeds the maximum amount from orders for the same code. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12098
train
v1
Schema: sales (alias: sale)(id, status, salary, code) staff(amount, value, date, type) Task: Retrieve value from sales whose type is found in staff rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12099
train