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: transactions (alias: txn)(type, level, date, value) schedules(date, code, salary, name) Task: Retrieve name from transactions with amount above the MIN(value) of schedules rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09200
train
v3
Schema: schedules (alias: schd)(level, name, salary, id) requests(value, type, code, amount) Task: Find code from schedules where salary exceeds the count of amount from requests for the same code. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09201
train
v1
Schema: orders (alias: ord)(status, id, name, level) employees(code, type, date, name) Task: Select value from orders where status exists in employees for the same type. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = ord.type );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09202
train
v3
Schema: schedules (alias: schd)(status, level, code, salary) products(amount, name, status, type) Task: Retrieve amount from schedules with amount above the COUNT(amount) of products rows sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09203
train
v3
Schema: tasks (alias: tsk)(status, salary, date, amount) transactions(code, value, amount, type) Task: Find value from tasks where amount exceeds the count of amount from transactions for the same level. SQL:
SELECT value FROM tasks AS tsk WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09204
train
v3
Schema: managers (alias: mgr)(id, status, salary, level) orders(id, status, name, value) Task: Find amount from managers where amount exceeds the total amount from orders for the same code. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.code = mgr.code );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09205
train
v3
Schema: schedules (alias: schd)(value, type, amount, name) regions(salary, type, code, level) Task: Find id from schedules where amount exceeds the total salary from regions for the same id. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09206
train
v2
Schema: invoices (alias: inv)(name, amount, level, code) customers(amount, level, id, type) Task: Retrieve code from invoices that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09207
train
v2
Schema: projects (alias: prj)(amount, name, code, date) products(value, status, date, salary) Task: Retrieve name from projects that have at least one corresponding entry in products sharing the same level. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = prj.level );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09208
train
v1
Schema: managers (alias: mgr)(value, name, date, amount) requests(salary, value, amount, id) Task: Find salary from managers where status appears in requests entries with matching code. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09209
train
v3
Schema: customers (alias: cust)(type, salary, name, level) items(value, status, type, id) Task: Retrieve id from customers with value above the AVG(value) of items rows sharing the same type. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT AVG(value) FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09210
train
v1
Schema: shipments (alias: shp)(salary, code, type, level) staff(salary, amount, level, date) Task: Retrieve value from shipments whose code is found in staff rows where level matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.level = shp.level );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09211
train
v2
Schema: products (alias: prod)(level, id, amount, salary) tasks(name, code, type, id) Task: Retrieve name from products that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = prod.id );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09212
train
v2
Schema: departments (alias: dept)(code, id, amount, salary) sales(type, level, status, date) Task: Find salary from departments where a matching record exists in sales with the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09213
train
v1
Schema: sales (alias: sale)(amount, code, date, salary) invoices(code, name, date, type) Task: Select salary from sales where type exists in invoices for the same code. SQL:
SELECT salary FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09214
train
v1
Schema: departments (alias: dept)(salary, code, id, type) items(level, amount, value, id) Task: Find name from departments where level appears in items entries with matching type. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09215
train
v2
Schema: branches (alias: brc)(amount, status, id, level) requests(amount, type, level, name) Task: Find name from branches where a matching record exists in requests with the same code. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = brc.code );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "name", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09216
train
v1
Schema: staff (alias: empl)(amount, name, type, code) shipments(code, name, amount, type) Task: Find id from staff where level appears in shipments entries with matching status. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09217
train
v1
Schema: branches (alias: brc)(level, date, salary, code) sales(value, amount, date, code) Task: Select code from branches where type exists in sales for the same id. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.id = brc.id );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09218
train
v1
Schema: items (alias: lne)(id, salary, type, amount) requests(amount, status, salary, date) Task: Find amount from items where code appears in requests entries with matching type. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = lne.type );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09219
train
v3
Schema: requests (alias: ordr)(salary, value, level, id) branches(code, date, name, type) Task: Find salary from requests where amount exceeds the maximum salary from branches for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09220
train
v1
Schema: customers (alias: cust)(date, level, status, code) transactions(id, date, name, amount) Task: Select id from customers where id exists in transactions for the same id. SQL:
SELECT id FROM customers AS cust WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09221
train
v1
Schema: categories (alias: catg)(date, amount, value, level) transactions(salary, status, type, code) Task: Select name from categories where type exists in transactions for the same id. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09222
train
v3
Schema: departments (alias: dept)(date, salary, id, name) shipments(level, status, id, name) Task: Find id from departments where value exceeds the count of value from shipments for the same status. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09223
train
v3
Schema: accounts (alias: acct)(type, amount, name, salary) schedules(date, name, amount, code) Task: Find name from accounts where value exceeds the total salary from schedules for the same status. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09224
train
v1
Schema: transactions (alias: txn)(amount, value, date, id) tasks(name, status, id, salary) Task: Select id from transactions where type exists in tasks for the same type. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.type = txn.type );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09225
train
v2
Schema: items (alias: lne)(level, type, value, salary) transactions(amount, value, id, date) Task: Find code from items where a matching record exists in transactions with the same type. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09226
train
v3
Schema: customers (alias: cust)(value, date, code, name) requests(value, code, date, salary) Task: Retrieve code from customers with salary above the COUNT(value) of requests rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09227
train
v2
Schema: departments (alias: dept)(level, status, code, amount) customers(code, status, name, date) Task: Retrieve code from departments that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09228
train
v2
Schema: products (alias: prod)(value, id, type, name) invoices(salary, amount, status, code) Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09229
train
v3
Schema: items (alias: lne)(value, amount, date, level) requests(status, type, id, amount) Task: Find code from items where amount exceeds the maximum value from requests for the same code. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.code = lne.code );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09230
train
v3
Schema: regions (alias: rgn)(date, code, id, status) departments(name, type, status, id) Task: Find id from regions where value exceeds the total salary from departments for the same type. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT SUM(salary) 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": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09231
train
v1
Schema: employees (alias: emp)(date, type, value, status) items(code, salary, date, value) Task: Find amount from employees where code appears in items entries with matching type. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09232
train
v3
Schema: departments (alias: dept)(id, status, value, type) orders(level, salary, type, code) Task: Retrieve name from departments with salary above the MAX(value) of orders rows sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09233
train
v2
Schema: sales (alias: sale)(name, level, type, code) schedules(status, date, salary, code) Task: Retrieve name from sales that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09234
train
v1
Schema: orders (alias: ord)(date, code, id, name) schedules(level, value, status, code) Task: Find amount from orders where id appears in schedules entries with matching status. SQL:
SELECT amount FROM orders AS ord WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09235
train
v1
Schema: sales (alias: sale)(status, name, type, level) schedules(id, amount, date, code) Task: Find id from sales where type appears in schedules entries with matching id. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09236
train
v2
Schema: requests (alias: ordr)(id, date, type, code) managers(id, name, type, value) Task: Find amount from requests where a matching record exists in managers with the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = ordr.type );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09237
train
v1
Schema: managers (alias: mgr)(code, name, level, status) customers(type, date, code, status) Task: Select amount from managers where status exists in customers for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.level = mgr.level );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09238
train
v3
Schema: orders (alias: ord)(date, id, amount, status) transactions(name, code, date, level) Task: Find salary from orders where value exceeds the maximum amount from transactions for the same type. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09239
train
v2
Schema: categories (alias: catg)(name, value, salary, code) invoices(code, type, date, amount) Task: Retrieve id from categories that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09240
train
v1
Schema: requests (alias: ordr)(salary, amount, level, date) employees(value, date, salary, level) Task: Retrieve value from requests whose status is found in employees rows where id matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09241
train
v2
Schema: orders (alias: ord)(amount, level, id, value) departments(date, name, status, amount) Task: Retrieve code from orders that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09242
train
v2
Schema: projects (alias: prj)(name, type, value, id) invoices(level, code, type, name) Task: Retrieve value from projects that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = prj.level );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "value", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09243
train
v1
Schema: invoices (alias: inv)(code, status, level, id) sales(status, amount, code, level) Task: Find value from invoices where level appears in sales entries with matching type. SQL:
SELECT value FROM invoices AS inv WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09244
train
v1
Schema: projects (alias: prj)(code, status, salary, name) schedules(code, status, value, name) Task: Find name from projects where status appears in schedules entries with matching status. SQL:
SELECT name FROM projects AS prj WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.status = prj.status );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09245
train
v2
Schema: regions (alias: rgn)(id, status, salary, code) categories(status, code, level, date) Task: Find amount from regions where a matching record exists in categories with the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09246
train
v3
Schema: transactions (alias: txn)(name, type, level, code) regions(status, type, amount, date) Task: Find id from transactions where value exceeds the minimum amount from regions for the same status. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09247
train
v1
Schema: managers (alias: mgr)(status, salary, code, type) schedules(id, salary, level, name) Task: Select amount from managers where id exists in schedules for the same status. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09248
train
v1
Schema: tasks (alias: tsk)(code, value, id, amount) shipments(status, id, date, salary) Task: Select code from tasks where id exists in shipments for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09249
train
v2
Schema: staff (alias: empl)(id, salary, date, level) items(type, level, name, value) Task: Find code from staff where a matching record exists in items with the same type. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = empl.type );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09250
train
v2
Schema: accounts (alias: acct)(status, level, id, amount) projects(date, id, status, value) Task: Find value from accounts where a matching record exists in projects with the same type. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = acct.type );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "value", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09251
train
v2
Schema: accounts (alias: acct)(name, amount, value, type) items(status, id, level, date) Task: Retrieve value from accounts that have at least one corresponding entry in items sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = acct.code );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09252
train
v3
Schema: sales (alias: sale)(id, code, value, type) managers(value, code, id, amount) Task: Find code from sales where value exceeds the maximum value from managers for the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09253
train
v2
Schema: requests (alias: ordr)(amount, value, status, date) regions(status, salary, level, amount) Task: Retrieve salary from requests that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09254
train
v3
Schema: customers (alias: cust)(level, salary, name, type) accounts(code, type, level, salary) Task: Find name from customers where salary exceeds the count of value from accounts for the same type. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09255
train
v3
Schema: items (alias: lne)(id, name, type, code) regions(amount, value, id, type) Task: Find name from items where salary exceeds the minimum value from regions for the same status. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09256
train
v2
Schema: requests (alias: ordr)(type, code, name, salary) branches(code, date, amount, level) Task: Find salary from requests where a matching record exists in branches with the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = ordr.level );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09257
train
v1
Schema: items (alias: lne)(value, code, level, amount) transactions(id, salary, date, amount) Task: Select id from items where status exists in transactions for the same id. SQL:
SELECT id FROM items AS lne WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09258
train
v2
Schema: tasks (alias: tsk)(value, type, code, amount) shipments(name, amount, id, date) Task: Retrieve name from tasks that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "name", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09259
train
v3
Schema: orders (alias: ord)(code, type, status, salary) sales(level, type, date, status) Task: Find id from orders where amount exceeds the minimum amount from sales for the same code. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.code = ord.code );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09260
train
v2
Schema: employees (alias: emp)(id, salary, value, name) customers(id, value, date, name) Task: Retrieve salary from employees that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "salary", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09261
train
v3
Schema: tasks (alias: tsk)(name, salary, amount, status) requests(level, status, code, amount) Task: Find code from tasks where value exceeds the minimum value from requests for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09262
train
v2
Schema: accounts (alias: acct)(code, type, name, amount) projects(date, salary, id, name) Task: Retrieve code from accounts that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = acct.id );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09263
train
v3
Schema: managers (alias: mgr)(salary, level, amount, value) categories(date, value, id, name) Task: Find id from managers where value exceeds the count of salary from categories for the same type. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.type = mgr.type );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09264
train
v3
Schema: managers (alias: mgr)(id, amount, code, salary) branches(id, level, amount, value) Task: Find code from managers where value exceeds the total salary from branches for the same type. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09265
train
v1
Schema: products (alias: prod)(value, id, name, date) customers(salary, status, type, level) Task: Select code from products where code exists in customers for the same type. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = prod.type );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09266
train
v2
Schema: invoices (alias: inv)(level, date, type, salary) items(date, status, id, level) Task: Find id from invoices where a matching record exists in items with the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09267
train
v1
Schema: managers (alias: mgr)(salary, name, date, id) branches(level, name, type, id) Task: Find amount from managers where status appears in branches entries with matching status. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.status = mgr.status );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09268
train
v1
Schema: customers (alias: cust)(type, id, value, status) transactions(status, type, value, name) Task: Find code from customers where type appears in transactions entries with matching status. SQL:
SELECT code FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09269
train
v3
Schema: orders (alias: ord)(type, amount, name, status) schedules(date, id, status, amount) Task: Retrieve value from orders with amount above the COUNT(value) of schedules rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09270
train
v1
Schema: shipments (alias: shp)(amount, value, name, id) regions(id, amount, type, value) Task: Find name from shipments where code appears in regions entries with matching status. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09271
train
v3
Schema: projects (alias: prj)(salary, type, id, name) sales(salary, code, value, status) Task: Retrieve id from projects with amount above the MIN(value) of sales rows sharing the same status. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT MIN(value) FROM sales AS sale WHERE sale.status = prj.status );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09272
train
v1
Schema: employees (alias: emp)(type, status, name, salary) accounts(name, code, date, salary) Task: Select salary from employees where id exists in accounts for the same level. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09273
train
v2
Schema: departments (alias: dept)(level, name, code, type) branches(status, id, name, level) Task: Retrieve code from departments that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09274
train
v2
Schema: items (alias: lne)(id, date, value, type) invoices(type, id, amount, value) Task: Find salary from items where a matching record exists in invoices with the same level. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "salary", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09275
train
v1
Schema: customers (alias: cust)(amount, value, status, type) employees(status, type, amount, level) Task: Find value from customers where type appears in employees entries with matching code. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = cust.code );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09276
train
v3
Schema: departments (alias: dept)(level, salary, value, type) customers(name, level, salary, type) Task: Retrieve id from departments with amount above the MAX(amount) of customers rows sharing the same level. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09277
train
v1
Schema: transactions (alias: txn)(status, type, date, id) sales(salary, value, name, id) Task: Find amount from transactions where level appears in sales entries with matching id. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09278
train
v1
Schema: regions (alias: rgn)(level, value, amount, date) tasks(name, date, status, type) Task: Find code from regions where code appears in tasks entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.status = rgn.status );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09279
train
v2
Schema: schedules (alias: schd)(value, amount, date, id) regions(value, level, salary, type) Task: Find name from schedules where a matching record exists in regions with the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09280
train
v2
Schema: customers (alias: cust)(value, code, id, salary) tasks(type, value, code, level) Task: Find value from customers where a matching record exists in tasks with the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = cust.status );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09281
train
v1
Schema: categories (alias: catg)(id, amount, status, type) customers(code, id, amount, name) Task: Retrieve name from categories whose status is found in customers rows where status matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09282
train
v2
Schema: customers (alias: cust)(id, type, salary, date) schedules(name, status, date, id) Task: Find name from customers where a matching record exists in schedules with the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09283
train
v1
Schema: customers (alias: cust)(amount, salary, name, code) requests(value, code, date, type) Task: Select code from customers where type exists in requests for the same id. SQL:
SELECT code FROM customers AS cust WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.id = cust.id );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09284
train
v1
Schema: transactions (alias: txn)(name, salary, level, date) tasks(salary, type, id, code) Task: Select amount from transactions where type exists in tasks for the same level. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = txn.level );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09285
train
v2
Schema: departments (alias: dept)(code, amount, name, salary) accounts(value, level, code, status) Task: Retrieve value from departments that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09286
train
v1
Schema: requests (alias: ordr)(salary, level, id, name) invoices(date, status, amount, type) Task: Retrieve value from requests whose status is found in invoices rows where status matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09287
train
v1
Schema: sales (alias: sale)(id, date, level, status) invoices(type, salary, code, name) Task: Retrieve code from sales whose code is found in invoices rows where id matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = sale.id );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09288
train
v1
Schema: invoices (alias: inv)(id, status, amount, code) departments(type, value, date, id) Task: Find code from invoices where type appears in departments entries with matching code. SQL:
SELECT code FROM invoices AS inv WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.code = inv.code );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09289
train
v2
Schema: invoices (alias: inv)(status, name, id, amount) regions(level, status, amount, code) Task: Retrieve code from invoices that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09290
train
v1
Schema: sales (alias: sale)(amount, code, name, salary) employees(salary, date, value, code) Task: Retrieve value from sales whose level is found in employees rows where type matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09291
train
v3
Schema: customers (alias: cust)(salary, id, amount, level) items(value, status, code, amount) Task: Find name from customers where value exceeds the average salary from items for the same code. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.code = cust.code );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09292
train
v2
Schema: accounts (alias: acct)(level, value, date, id) employees(date, salary, amount, type) Task: Find amount from accounts where a matching record exists in employees with the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09293
train
v1
Schema: branches (alias: brc)(status, type, id, code) managers(name, code, type, date) Task: Retrieve value from branches whose id is found in managers rows where status matches the outer record. SQL:
SELECT value FROM branches AS brc WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = brc.status );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09294
train
v1
Schema: departments (alias: dept)(salary, code, date, type) managers(salary, code, date, status) Task: Retrieve name from departments whose code is found in managers rows where level matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = dept.level );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09295
train
v3
Schema: transactions (alias: txn)(status, value, amount, salary) projects(level, amount, salary, date) Task: Retrieve amount from transactions with value above the MAX(salary) of projects rows sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.type = txn.type );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09296
train
v1
Schema: employees (alias: emp)(value, id, date, amount) departments(status, id, name, date) Task: Retrieve value from employees whose type is found in departments rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09297
train
v1
Schema: branches (alias: brc)(salary, status, level, date) orders(type, salary, status, id) Task: Find id from branches where status appears in orders entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = brc.code );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09298
train
v2
Schema: schedules (alias: schd)(id, salary, name, date) sales(salary, name, date, type) Task: Find value from schedules where a matching record exists in sales with the same code. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09299
train