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
v3
Schema: items (alias: lne)(type, code, value, status) employees(status, type, amount, code) Task: Retrieve id from items with value above the MIN(salary) of employees rows sharing the same level. SQL:
SELECT id FROM items AS lne WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.level = lne.level );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12100
train
v1
Schema: categories (alias: catg)(value, id, code, status) shipments(level, amount, status, salary) Task: Find code from categories where id appears in shipments entries with matching status. SQL:
SELECT code FROM categories AS catg WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12101
train
v2
Schema: categories (alias: catg)(amount, id, date, level) orders(level, value, salary, date) Task: Retrieve value from categories that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12102
train
v2
Schema: employees (alias: emp)(type, code, level, name) tasks(date, value, id, name) Task: Find name from employees where a matching record exists in tasks with the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12103
train
v3
Schema: orders (alias: ord)(name, id, type, date) shipments(status, salary, value, level) Task: Retrieve name from orders with value above the SUM(value) of shipments rows sharing the same id. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12104
train
v2
Schema: transactions (alias: txn)(id, code, value, salary) products(name, date, code, id) Task: Find amount from transactions where a matching record exists in products with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12105
train
v1
Schema: invoices (alias: inv)(id, date, salary, status) projects(id, amount, date, value) Task: Select value from invoices where status exists in projects for the same type. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12106
train
v1
Schema: customers (alias: cust)(id, type, amount, value) tasks(id, name, amount, salary) Task: Select code from customers where level exists in tasks for the same code. SQL:
SELECT code FROM customers AS cust WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = cust.code );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12107
train
v3
Schema: projects (alias: prj)(amount, id, code, type) accounts(date, salary, code, id) Task: Retrieve code from projects with value above the COUNT(amount) of accounts rows sharing the same status. SQL:
SELECT code FROM projects AS prj WHERE value > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.status = prj.status );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12108
train
v3
Schema: branches (alias: brc)(level, id, type, amount) requests(date, status, name, code) Task: Retrieve code from branches with salary above the MIN(value) of requests rows sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.level = brc.level );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12109
train
v3
Schema: sales (alias: sale)(type, name, value, status) branches(amount, level, type, name) Task: Retrieve id from sales with salary above the AVG(value) of branches rows sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT AVG(value) FROM branches AS brc WHERE brc.status = sale.status );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12110
train
v2
Schema: managers (alias: mgr)(value, salary, date, type) regions(name, amount, status, date) Task: Retrieve name from managers that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12111
train
v3
Schema: requests (alias: ordr)(name, status, date, type) items(id, date, type, code) Task: Retrieve salary from requests with salary above the COUNT(salary) of items rows sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = ordr.level );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12112
train
v1
Schema: sales (alias: sale)(level, id, date, type) requests(name, amount, code, type) Task: Retrieve amount from sales whose status is found in requests rows where status matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = sale.status );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12113
train
v2
Schema: sales (alias: sale)(amount, type, level, name) managers(salary, level, type, id) Task: Find code from sales where a matching record exists in managers with the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = sale.id );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12114
train
v3
Schema: shipments (alias: shp)(value, status, amount, code) branches(date, value, name, level) Task: Retrieve code from shipments with salary above the MIN(amount) of branches rows sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.status = shp.status );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12115
train
v1
Schema: schedules (alias: schd)(id, status, level, value) sales(name, amount, value, type) Task: Retrieve id from schedules whose level is found in sales rows where type matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12116
train
v2
Schema: regions (alias: rgn)(name, status, amount, code) shipments(name, date, status, value) Task: Find salary from regions where a matching record exists in shipments with the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12117
train
v2
Schema: sales (alias: sale)(level, code, name, date) branches(name, value, code, type) Task: Retrieve salary from sales that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = sale.level );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12118
train
v1
Schema: products (alias: prod)(id, status, salary, type) employees(amount, id, salary, status) Task: Find value from products where level appears in employees entries with matching id. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12119
train
v3
Schema: accounts (alias: acct)(date, name, code, type) regions(amount, salary, code, id) Task: Find value from accounts where salary exceeds the maximum amount from regions for the same level. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12120
train
v3
Schema: employees (alias: emp)(amount, level, date, name) projects(salary, name, code, id) Task: Retrieve value from employees with amount above the MAX(salary) of projects rows sharing the same level. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.level = emp.level );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12121
train
v3
Schema: items (alias: lne)(code, type, id, name) schedules(id, type, code, status) Task: Find code from items where salary exceeds the minimum amount from schedules for the same id. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.id = lne.id );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12122
train
v3
Schema: shipments (alias: shp)(name, date, amount, type) sales(type, status, amount, id) Task: Find code from shipments where amount exceeds the average amount from sales for the same code. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12123
train
v3
Schema: products (alias: prod)(type, date, salary, name) accounts(date, salary, id, type) Task: Find id from products where value exceeds the minimum salary from accounts for the same code. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12124
train
v1
Schema: sales (alias: sale)(name, amount, id, date) items(name, salary, type, id) Task: Find code from sales where type appears in items entries with matching type. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12125
train
v3
Schema: departments (alias: dept)(type, date, status, code) invoices(type, date, code, level) Task: Find value from departments where amount exceeds the minimum value from invoices for the same code. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.code = dept.code );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12126
train
v1
Schema: requests (alias: ordr)(type, status, code, value) departments(code, salary, level, type) Task: Retrieve salary from requests whose id is found in departments rows where status matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12127
train
v3
Schema: requests (alias: ordr)(salary, status, amount, code) invoices(value, code, amount, salary) Task: Find id from requests where salary exceeds the total salary from invoices for the same level. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12128
train
v1
Schema: schedules (alias: schd)(name, value, status, id) accounts(status, code, level, salary) Task: Find name from schedules where status appears in accounts entries with matching status. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12129
train
v1
Schema: transactions (alias: txn)(value, code, date, salary) departments(date, value, status, type) Task: Retrieve name from transactions whose level is found in departments rows where level matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = txn.level );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12130
train
v1
Schema: branches (alias: brc)(type, salary, id, amount) tasks(date, status, amount, level) Task: Find id from branches where level appears in tasks entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12131
train
v2
Schema: employees (alias: emp)(date, value, status, salary) tasks(name, level, status, id) Task: Retrieve id from employees that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = emp.type );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12132
train
v1
Schema: accounts (alias: acct)(date, code, type, level) departments(id, value, status, amount) Task: Find amount from accounts where level appears in departments entries with matching level. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12133
train
v1
Schema: accounts (alias: acct)(date, status, id, name) customers(name, level, id, amount) Task: Find name from accounts where code appears in customers entries with matching status. SQL:
SELECT name 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": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12134
train
v2
Schema: branches (alias: brc)(amount, type, date, code) regions(name, type, code, id) Task: Retrieve code from branches that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = brc.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12135
train
v1
Schema: staff (alias: empl)(name, date, value, salary) departments(salary, type, name, date) Task: Select salary from staff where type exists in departments for the same level. SQL:
SELECT salary FROM staff AS empl WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12136
train
v3
Schema: projects (alias: prj)(value, code, name, salary) regions(amount, code, level, salary) Task: Find id from projects where amount exceeds the count of amount from regions for the same code. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.code = prj.code );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12137
train
v1
Schema: managers (alias: mgr)(id, name, type, salary) regions(id, code, level, value) Task: Retrieve salary from managers whose type is found in regions rows where type matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12138
train
v3
Schema: requests (alias: ordr)(status, type, date, code) branches(name, salary, level, type) Task: Find amount from requests where salary exceeds the minimum value from branches for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT MIN(value) FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12139
train
v2
Schema: employees (alias: emp)(status, code, value, date) invoices(id, code, date, type) Task: Find amount from employees where a matching record exists in invoices with the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12140
train
v1
Schema: items (alias: lne)(name, level, date, amount) invoices(amount, value, type, code) Task: Select id from items where id exists in invoices for the same status. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12141
train
v2
Schema: staff (alias: empl)(id, code, level, type) invoices(code, salary, level, status) Task: Retrieve value from staff that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12142
train
v3
Schema: projects (alias: prj)(amount, name, status, code) products(status, date, amount, id) Task: Retrieve value from projects with value above the SUM(value) of products rows sharing the same status. SQL:
SELECT value FROM projects AS prj WHERE value > ( SELECT SUM(value) FROM products AS prod WHERE prod.status = prj.status );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12143
train
v3
Schema: customers (alias: cust)(salary, id, level, code) regions(amount, date, level, code) Task: Find name from customers where amount exceeds the minimum amount from regions for the same status. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12144
train
v1
Schema: staff (alias: empl)(status, name, salary, date) employees(level, value, salary, status) Task: Retrieve amount from staff whose id is found in employees rows where code matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12145
train
v1
Schema: schedules (alias: schd)(date, salary, name, type) products(value, salary, name, id) Task: Select name from schedules where status exists in products for the same id. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = schd.id );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12146
train
v3
Schema: branches (alias: brc)(date, value, amount, type) requests(date, type, status, name) Task: Find name from branches where amount exceeds the minimum value from requests for the same type. SQL:
SELECT name FROM branches AS brc WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.type = brc.type );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12147
train
v2
Schema: staff (alias: empl)(level, amount, id, value) products(level, type, value, status) Task: Retrieve id from staff that have at least one corresponding entry in products sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = empl.type );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12148
train
v1
Schema: employees (alias: emp)(salary, id, level, amount) projects(status, date, code, level) Task: Retrieve id from employees whose code is found in projects rows where status matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.status = emp.status );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12149
train
v1
Schema: schedules (alias: schd)(type, date, salary, status) invoices(salary, amount, name, code) Task: Find amount from schedules where code appears in invoices entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12150
train
v3
Schema: schedules (alias: schd)(amount, status, date, salary) transactions(code, type, amount, status) Task: Retrieve id from schedules with salary above the MIN(value) of transactions rows sharing the same status. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12151
train
v2
Schema: accounts (alias: acct)(type, name, status, date) branches(level, code, type, id) Task: Find code from accounts where a matching record exists in branches with the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12152
train
v1
Schema: products (alias: prod)(id, salary, amount, type) managers(level, type, name, salary) Task: Select value from products where level exists in managers for the same level. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12153
train
v1
Schema: products (alias: prod)(amount, type, code, status) schedules(code, name, amount, salary) Task: Select code from products where id exists in schedules for the same type. SQL:
SELECT code FROM products AS prod WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12154
train
v1
Schema: items (alias: lne)(level, status, name, id) invoices(status, salary, id, value) Task: Find code from items where status appears in invoices entries with matching level. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12155
train
v2
Schema: orders (alias: ord)(date, value, code, amount) schedules(salary, amount, value, name) Task: Find name from orders where a matching record exists in schedules with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12156
train
v3
Schema: orders (alias: ord)(date, status, amount, value) regions(id, level, name, value) Task: Find amount from orders where amount exceeds the maximum amount from regions for the same status. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12157
train
v3
Schema: branches (alias: brc)(id, level, amount, name) accounts(status, name, code, type) Task: Retrieve salary from branches with amount above the MIN(amount) of accounts rows sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.id = brc.id );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12158
train
v2
Schema: managers (alias: mgr)(type, level, id, code) transactions(id, value, name, amount) Task: Retrieve salary from managers that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12159
train
v3
Schema: items (alias: lne)(date, level, type, value) tasks(date, name, type, status) Task: Find amount from items where amount exceeds the minimum salary from tasks for the same type. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.type = lne.type );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12160
train
v3
Schema: requests (alias: ordr)(status, date, value, salary) employees(type, amount, code, salary) Task: Find code from requests where value exceeds the count of salary from employees for the same level. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "code", "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_12161
train
v2
Schema: managers (alias: mgr)(date, amount, type, level) customers(value, status, id, name) Task: Find code from managers where a matching record exists in customers with the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = mgr.level );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12162
train
v3
Schema: categories (alias: catg)(name, level, value, status) transactions(name, id, level, date) Task: Retrieve salary from categories with amount above the AVG(amount) of transactions rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12163
train
v2
Schema: sales (alias: sale)(salary, date, code, name) items(date, salary, amount, code) Task: Find value from sales where a matching record exists in items with the same type. SQL:
SELECT value 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": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12164
train
v3
Schema: products (alias: prod)(name, type, value, code) regions(amount, type, id, level) Task: Retrieve value from products with salary above the MIN(value) of regions rows sharing the same type. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12165
train
v3
Schema: products (alias: prod)(type, name, value, date) sales(value, type, id, code) Task: Retrieve amount from products with salary above the SUM(amount) of sales rows sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12166
train
v1
Schema: staff (alias: empl)(value, date, name, amount) schedules(type, level, code, date) Task: Find name from staff where status appears in schedules entries with matching code. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12167
train
v1
Schema: items (alias: lne)(name, type, level, code) tasks(name, id, code, salary) Task: Select value from items where code exists in tasks for the same level. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12168
train
v2
Schema: projects (alias: prj)(name, level, amount, status) shipments(value, status, amount, date) Task: Retrieve value from projects that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prj.id );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12169
train
v1
Schema: schedules (alias: schd)(name, status, date, code) orders(name, type, id, level) Task: Retrieve id from schedules whose code is found in orders rows where type matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12170
train
v1
Schema: schedules (alias: schd)(status, type, id, code) customers(value, salary, id, name) Task: Find id from schedules where code appears in customers entries with matching code. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = schd.code );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12171
train
v2
Schema: schedules (alias: schd)(amount, level, code, value) accounts(level, salary, name, status) Task: Find value from schedules where a matching record exists in accounts with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12172
train
v1
Schema: transactions (alias: txn)(code, id, level, date) orders(id, status, amount, name) Task: Find salary from transactions where status appears in orders entries with matching type. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = txn.type );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12173
train
v1
Schema: schedules (alias: schd)(name, type, level, code) invoices(id, amount, name, value) Task: Retrieve value from schedules whose code is found in invoices rows where id matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = schd.id );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12174
train
v3
Schema: departments (alias: dept)(amount, value, code, salary) products(type, value, date, name) Task: Find salary from departments where amount exceeds the maximum amount from products for the same id. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM products AS prod WHERE prod.id = dept.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12175
train
v2
Schema: employees (alias: emp)(amount, type, id, code) orders(amount, level, date, code) Task: Find amount from employees where a matching record exists in orders with the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12176
train
v1
Schema: transactions (alias: txn)(level, amount, type, id) schedules(amount, id, date, name) Task: Select id from transactions where level exists in schedules for the same id. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.id = txn.id );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12177
train
v1
Schema: employees (alias: emp)(amount, date, status, salary) requests(date, id, value, status) Task: Select salary from employees where status exists in requests for the same status. SQL:
SELECT salary FROM employees AS emp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = emp.status );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12178
train
v1
Schema: managers (alias: mgr)(status, level, code, salary) departments(value, code, amount, level) Task: Select code from managers where id exists in departments for the same type. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12179
train
v3
Schema: orders (alias: ord)(status, date, salary, amount) products(value, code, salary, status) Task: Retrieve name from orders with salary above the AVG(value) of products rows sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT AVG(value) FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12180
train
v2
Schema: schedules (alias: schd)(salary, code, type, value) regions(name, amount, status, type) Task: Retrieve value from schedules that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12181
train
v2
Schema: items (alias: lne)(amount, salary, level, value) projects(date, value, code, name) Task: Find value from items where a matching record exists in projects with the same level. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12182
train
v2
Schema: tasks (alias: tsk)(type, code, id, level) products(level, status, id, code) Task: Find id from tasks where a matching record exists in products with the same code. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12183
train
v1
Schema: projects (alias: prj)(type, value, name, status) requests(id, level, code, name) Task: Find name from projects where id appears in requests entries with matching status. SQL:
SELECT name FROM projects AS prj WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.status = prj.status );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12184
train
v2
Schema: accounts (alias: acct)(amount, name, date, code) orders(amount, name, date, status) Task: Find id from accounts where a matching record exists in orders with the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12185
train
v2
Schema: staff (alias: empl)(status, type, name, salary) transactions(value, code, level, type) Task: Find salary from staff where a matching record exists in transactions with the same level. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12186
train
v3
Schema: tasks (alias: tsk)(level, name, type, value) employees(name, id, date, amount) Task: Retrieve name from tasks with value above the MAX(amount) of employees rows sharing the same level. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12187
train
v2
Schema: regions (alias: rgn)(status, value, id, date) items(type, status, amount, code) Task: Retrieve id from regions that have at least one corresponding entry in items sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = rgn.status );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12188
train
v1
Schema: requests (alias: ordr)(salary, amount, value, name) transactions(status, value, name, id) Task: Find value from requests where status appears in transactions entries with matching status. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12189
train
v3
Schema: categories (alias: catg)(type, amount, id, status) transactions(date, type, code, name) Task: Find value from categories where salary exceeds the count of value from transactions for the same level. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12190
train
v2
Schema: sales (alias: sale)(level, status, name, salary) staff(level, code, type, salary) Task: Find name from sales where a matching record exists in staff with the same type. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12191
train
v2
Schema: tasks (alias: tsk)(date, code, amount, value) employees(salary, date, status, value) Task: Retrieve name from tasks that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12192
train
v1
Schema: transactions (alias: txn)(salary, id, date, type) customers(amount, level, id, status) Task: Select salary from transactions where id exists in customers for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12193
train
v1
Schema: customers (alias: cust)(level, name, amount, status) accounts(id, type, amount, date) Task: Retrieve id from customers whose level is found in accounts rows where type matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12194
train
v3
Schema: schedules (alias: schd)(name, status, salary, value) regions(date, value, code, name) Task: Find amount from schedules where amount exceeds the count of salary from regions for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12195
train
v3
Schema: sales (alias: sale)(amount, type, value, code) staff(level, status, code, date) Task: Retrieve value from sales with amount above the MAX(salary) of staff rows sharing the same id. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12196
train
v2
Schema: categories (alias: catg)(salary, level, date, name) tasks(type, name, salary, status) Task: Find id from categories where a matching record exists in tasks with the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12197
train
v2
Schema: schedules (alias: schd)(id, type, salary, date) orders(amount, status, type, value) Task: Find code from schedules where a matching record exists in orders with the same level. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12198
train
v1
Schema: categories (alias: catg)(level, name, value, status) tasks(level, amount, id, name) Task: Find value from categories where code appears in tasks entries with matching code. SQL:
SELECT value FROM categories AS catg WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12199
train