variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v1
Schema: sales (alias: sale)(value, type, amount, date) customers(salary, name, date, amount) Task: Find id from sales where status appears in customers entries with matching id. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01300
train
v2
Schema: tasks (alias: tsk)(type, date, amount, code) orders(type, salary, value, code) Task: Find code from tasks where a matching record exists in orders with the same level. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01301
train
v3
Schema: managers (alias: mgr)(level, amount, code, salary) transactions(status, name, value, type) Task: Find code from managers where value exceeds the minimum value from transactions for the same code. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01302
train
v1
Schema: tasks (alias: tsk)(value, salary, id, status) employees(status, date, code, type) Task: Select id from tasks where level exists in employees for the same status. SQL:
SELECT id FROM tasks AS tsk WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01303
train
v2
Schema: categories (alias: catg)(date, amount, status, level) transactions(date, id, status, level) Task: Retrieve id from categories that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01304
train
v1
Schema: shipments (alias: shp)(amount, id, status, date) schedules(type, date, code, level) Task: Find id from shipments where id appears in schedules entries with matching type. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01305
train
v3
Schema: sales (alias: sale)(salary, amount, name, value) staff(salary, status, date, level) Task: Find name from sales where amount exceeds the maximum value from staff for the same type. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT MAX(value) FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01306
train
v1
Schema: branches (alias: brc)(amount, name, value, level) managers(value, status, code, id) Task: Select code from branches where id exists in managers for the same id. SQL:
SELECT code FROM branches AS brc WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = brc.id );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01307
train
v1
Schema: schedules (alias: schd)(status, value, code, id) categories(value, level, code, type) Task: Retrieve code from schedules whose level is found in categories rows where code matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01308
train
v1
Schema: tasks (alias: tsk)(code, status, salary, value) staff(type, date, value, level) Task: Select id from tasks where id exists in staff for the same id. SQL:
SELECT id FROM tasks AS tsk WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01309
train
v2
Schema: sales (alias: sale)(value, name, date, status) managers(type, level, id, code) Task: Retrieve value from sales that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01310
train
v2
Schema: accounts (alias: acct)(status, date, value, level) sales(value, type, name, id) Task: Retrieve id from accounts that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = acct.type );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01311
train
v3
Schema: branches (alias: brc)(name, value, salary, code) customers(code, value, type, level) Task: Retrieve id from branches with salary above the COUNT(salary) of customers rows sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01312
train
v1
Schema: staff (alias: empl)(value, type, salary, amount) tasks(date, code, salary, value) Task: Select code from staff where status exists in tasks for the same type. SQL:
SELECT code FROM staff AS empl WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.type = empl.type );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01313
train
v1
Schema: products (alias: prod)(name, type, id, status) staff(id, type, value, level) Task: Find name from products where type appears in staff entries with matching code. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = prod.code );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01314
train
v3
Schema: requests (alias: ordr)(level, id, name, value) items(code, id, level, value) Task: Find value from requests where amount exceeds the count of value from items for the same id. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT COUNT(value) FROM items AS lne WHERE lne.id = ordr.id );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01315
train
v1
Schema: invoices (alias: inv)(id, status, date, amount) orders(date, salary, amount, type) Task: Select id from invoices where status exists in orders for the same status. SQL:
SELECT id FROM invoices AS inv WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01316
train
v1
Schema: employees (alias: emp)(amount, value, id, status) items(value, name, id, type) Task: Find amount from employees where level appears in items entries with matching code. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = emp.code );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01317
train
v2
Schema: shipments (alias: shp)(amount, value, date, code) schedules(amount, status, salary, type) Task: Retrieve amount from shipments that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01318
train
v1
Schema: orders (alias: ord)(value, id, amount, type) invoices(value, level, type, date) Task: Retrieve amount from orders whose status is found in invoices rows where level matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01319
train
v3
Schema: items (alias: lne)(status, code, id, salary) tasks(type, level, status, name) Task: Find name from items where amount exceeds the minimum salary from tasks for the same type. SQL:
SELECT name 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": "name", "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_01320
train
v1
Schema: requests (alias: ordr)(date, level, salary, name) sales(code, status, value, id) Task: Retrieve name from requests whose code is found in sales rows where id matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01321
train
v2
Schema: orders (alias: ord)(status, date, level, salary) employees(salary, value, date, status) Task: Find name from orders where a matching record exists in employees with the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01322
train
v1
Schema: customers (alias: cust)(code, salary, type, status) sales(name, amount, date, type) Task: Retrieve id from customers whose code is found in sales rows where code matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = cust.code );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01323
train
v3
Schema: staff (alias: empl)(id, name, value, type) departments(salary, amount, level, code) Task: Retrieve id from staff with value above the SUM(value) of departments rows sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT SUM(value) FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01324
train
v2
Schema: invoices (alias: inv)(salary, code, value, amount) customers(type, id, salary, amount) Task: Find id from invoices where a matching record exists in customers with the same type. SQL:
SELECT id 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": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01325
train
v3
Schema: sales (alias: sale)(amount, name, level, status) transactions(amount, date, status, value) Task: Retrieve value from sales with amount above the MIN(amount) of transactions rows sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01326
train
v2
Schema: schedules (alias: schd)(code, amount, status, salary) projects(id, date, code, salary) Task: Find id from schedules where a matching record exists in projects with the same code. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01327
train
v3
Schema: requests (alias: ordr)(value, id, amount, code) employees(amount, level, code, date) Task: Find id from requests where salary exceeds the average salary from employees for the same status. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01328
train
v1
Schema: staff (alias: empl)(amount, name, level, id) employees(code, amount, type, value) Task: Select id from staff where type exists in employees for the same code. SQL:
SELECT id FROM staff AS empl WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01329
train
v1
Schema: categories (alias: catg)(salary, name, date, amount) accounts(type, code, status, id) Task: Retrieve code from categories whose level is found in accounts rows where status matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.status = catg.status );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01330
train
v1
Schema: shipments (alias: shp)(salary, status, id, level) items(date, amount, salary, code) Task: Select amount from shipments where code exists in items for the same code. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01331
train
v2
Schema: invoices (alias: inv)(code, id, amount, date) customers(salary, name, amount, level) Task: Find amount from invoices where a matching record exists in customers with the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01332
train
v3
Schema: transactions (alias: txn)(name, date, type, amount) invoices(amount, name, salary, value) Task: Find salary from transactions where amount exceeds the minimum salary from invoices for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01333
train
v3
Schema: projects (alias: prj)(status, level, amount, value) departments(amount, code, salary, type) Task: Retrieve amount from projects with value above the SUM(salary) of departments rows sharing the same status. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01334
train
v2
Schema: staff (alias: empl)(date, level, amount, value) requests(type, level, id, date) Task: Retrieve amount from staff that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01335
train
v1
Schema: sales (alias: sale)(status, level, name, id) accounts(salary, amount, type, name) Task: Select name from sales where type exists in accounts for the same level. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01336
train
v2
Schema: customers (alias: cust)(salary, value, type, code) categories(id, amount, status, level) Task: Retrieve salary from customers that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01337
train
v3
Schema: managers (alias: mgr)(id, code, level, status) departments(type, value, name, level) Task: Retrieve value from managers with value above the MAX(value) of departments rows sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT MAX(value) FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01338
train
v2
Schema: invoices (alias: inv)(date, amount, code, value) sales(code, name, amount, type) Task: Find code from invoices where a matching record exists in sales with the same level. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = inv.level );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01339
train
v1
Schema: regions (alias: rgn)(salary, code, level, id) shipments(level, code, name, value) Task: Find id from regions where level appears in shipments entries with matching type. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01340
train
v3
Schema: transactions (alias: txn)(value, id, code, salary) categories(name, value, amount, code) Task: Find code from transactions where amount exceeds the average value from categories for the same type. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM categories AS catg WHERE catg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01341
train
v1
Schema: categories (alias: catg)(code, status, value, amount) requests(value, level, code, date) Task: Retrieve id from categories whose id is found in requests rows where id matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01342
train
v1
Schema: sales (alias: sale)(level, id, date, salary) requests(level, date, name, amount) Task: Retrieve value from sales whose id is found in requests rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = sale.code );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01343
train
v1
Schema: branches (alias: brc)(salary, type, amount, status) shipments(type, value, code, level) Task: Find value from branches where id appears in shipments entries with matching type. SQL:
SELECT value FROM branches AS brc WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.type = brc.type );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01344
train
v2
Schema: tasks (alias: tsk)(id, salary, status, date) staff(salary, amount, value, name) Task: Retrieve name from tasks that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01345
train
v3
Schema: projects (alias: prj)(name, code, id, level) employees(value, code, salary, status) Task: Retrieve code from projects with amount above the AVG(salary) of employees rows sharing the same level. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.level = prj.level );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01346
train
v3
Schema: categories (alias: catg)(type, code, value, date) managers(salary, name, amount, code) Task: Retrieve salary from categories with amount above the MIN(value) of managers rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.type = catg.type );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01347
train
v3
Schema: branches (alias: brc)(type, name, amount, id) products(date, name, code, status) Task: Retrieve salary from branches with amount above the MAX(value) of products rows sharing the same status. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT MAX(value) FROM products AS prod WHERE prod.status = brc.status );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01348
train
v1
Schema: shipments (alias: shp)(name, amount, status, date) schedules(amount, name, type, id) Task: Retrieve name from shipments whose type is found in schedules rows where id matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01349
train
v2
Schema: employees (alias: emp)(value, amount, level, date) requests(code, id, value, type) Task: Retrieve name from employees that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "name", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01350
train
v3
Schema: transactions (alias: txn)(code, date, level, amount) requests(value, level, date, id) Task: Find value from transactions where value exceeds the minimum amount from requests for the same id. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01351
train
v1
Schema: items (alias: lne)(id, level, salary, code) shipments(id, level, salary, code) Task: Find id from items where level appears in shipments entries with matching type. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01352
train
v3
Schema: departments (alias: dept)(value, code, id, date) managers(level, name, salary, id) Task: Retrieve name from departments with amount above the MAX(amount) of managers rows sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MAX(amount) 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": "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_01353
train
v3
Schema: orders (alias: ord)(id, type, amount, name) sales(amount, code, type, value) Task: Retrieve value from orders with salary above the MAX(salary) of sales rows sharing the same type. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01354
train
v3
Schema: projects (alias: prj)(value, level, date, code) staff(amount, type, salary, value) Task: Retrieve id from projects with value above the COUNT(amount) of staff rows sharing the same code. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.code = prj.code );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01355
train
v2
Schema: managers (alias: mgr)(date, id, name, status) transactions(value, date, level, id) Task: Retrieve id from managers that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01356
train
v2
Schema: employees (alias: emp)(amount, salary, status, date) accounts(name, status, type, code) Task: Find id from employees where a matching record exists in accounts with the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01357
train
v2
Schema: orders (alias: ord)(id, value, amount, code) shipments(status, salary, date, type) Task: Find amount from orders where a matching record exists in shipments with the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ord.status );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01358
train
v2
Schema: shipments (alias: shp)(value, code, id, level) staff(name, type, status, salary) Task: Retrieve name from shipments that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01359
train
v3
Schema: transactions (alias: txn)(code, level, salary, status) shipments(id, value, status, date) Task: Retrieve id from transactions with salary above the AVG(amount) of shipments rows sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01360
train
v1
Schema: invoices (alias: inv)(amount, salary, id, type) categories(type, date, code, level) Task: Select amount from invoices where level exists in categories for the same status. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01361
train
v1
Schema: orders (alias: ord)(level, id, code, value) shipments(date, salary, status, value) Task: Find amount from orders where code appears in shipments entries with matching code. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = ord.code );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01362
train
v1
Schema: regions (alias: rgn)(code, amount, type, salary) managers(salary, status, amount, value) Task: Select code from regions where status exists in managers for the same id. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01363
train
v2
Schema: categories (alias: catg)(type, id, date, status) transactions(level, code, value, amount) Task: Find salary from categories where a matching record exists in transactions with the same level. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01364
train
v3
Schema: customers (alias: cust)(date, status, code, amount) staff(date, id, salary, code) Task: Find code from customers where amount exceeds the maximum amount from staff for the same status. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.status = cust.status );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01365
train
v2
Schema: orders (alias: ord)(type, level, amount, id) departments(salary, amount, status, level) Task: Find name from orders where a matching record exists in departments with the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01366
train
v1
Schema: customers (alias: cust)(code, level, name, type) managers(name, date, status, salary) Task: Retrieve amount from customers whose level is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01367
train
v3
Schema: orders (alias: ord)(code, level, amount, status) staff(level, code, status, date) Task: Find code from orders where salary exceeds the total salary from staff for the same status. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.status = ord.status );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01368
train
v1
Schema: managers (alias: mgr)(level, type, amount, value) accounts(date, level, status, type) Task: Find value from managers where level appears in accounts entries with matching type. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01369
train
v1
Schema: managers (alias: mgr)(id, salary, amount, type) accounts(amount, salary, type, value) Task: Find code from managers where status appears in accounts entries with matching status. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01370
train
v3
Schema: products (alias: prod)(date, code, level, amount) customers(value, amount, level, status) Task: Retrieve salary from products with value above the SUM(salary) of customers rows sharing the same level. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.level = prod.level );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01371
train
v2
Schema: products (alias: prod)(type, value, date, level) invoices(id, code, value, status) Task: Find code from products where a matching record exists in invoices with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01372
train
v1
Schema: orders (alias: ord)(amount, type, value, salary) projects(salary, id, name, amount) Task: Retrieve amount from orders whose level is found in projects rows where id matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.id = ord.id );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01373
train
v1
Schema: accounts (alias: acct)(name, type, level, value) staff(level, value, amount, date) Task: Select id from accounts where id exists in staff for the same level. SQL:
SELECT id FROM accounts AS acct WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01374
train
v2
Schema: sales (alias: sale)(code, type, salary, value) invoices(level, amount, value, code) Task: Find salary from sales where a matching record exists in invoices with the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01375
train
v3
Schema: products (alias: prod)(id, name, value, salary) invoices(amount, status, type, id) Task: Find amount from products where amount exceeds the average salary from invoices for the same status. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01376
train
v1
Schema: regions (alias: rgn)(date, name, id, value) shipments(name, level, date, type) Task: Find value from regions where id appears in shipments entries with matching code. SQL:
SELECT value FROM regions AS rgn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01377
train
v2
Schema: employees (alias: emp)(value, salary, status, code) customers(code, id, level, date) Task: Find name from employees where a matching record exists in customers with the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01378
train
v3
Schema: sales (alias: sale)(name, value, id, code) staff(status, amount, salary, value) Task: Retrieve value from sales with salary above the MAX(amount) of staff rows sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01379
train
v2
Schema: employees (alias: emp)(date, name, code, type) categories(salary, value, level, type) Task: Retrieve amount from employees that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01380
train
v2
Schema: staff (alias: empl)(amount, level, code, type) products(id, value, level, type) Task: Retrieve name from staff that have at least one corresponding entry in products sharing the same level. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01381
train
v3
Schema: managers (alias: mgr)(type, level, name, amount) regions(name, amount, value, code) Task: Find amount from managers where salary exceeds the average salary from regions for the same status. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01382
train
v3
Schema: accounts (alias: acct)(code, id, level, type) sales(date, id, amount, status) Task: Retrieve amount from accounts with amount above the AVG(salary) of sales rows sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01383
train
v3
Schema: managers (alias: mgr)(value, id, level, amount) projects(type, value, amount, level) Task: Find salary from managers where value exceeds the maximum amount from projects for the same level. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.level = mgr.level );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01384
train
v2
Schema: accounts (alias: acct)(amount, id, value, date) schedules(value, id, level, amount) Task: Retrieve name from accounts that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01385
train
v3
Schema: departments (alias: dept)(salary, id, type, name) staff(value, type, code, date) Task: Find id from departments where salary exceeds the average salary from staff for the same id. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = dept.id );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01386
train
v3
Schema: sales (alias: sale)(level, salary, status, id) items(type, name, status, amount) Task: Retrieve salary from sales with salary above the SUM(salary) of items rows sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01387
train
v2
Schema: projects (alias: prj)(id, salary, code, date) tasks(name, status, level, salary) Task: Retrieve amount from projects that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01388
train
v3
Schema: customers (alias: cust)(type, date, name, id) transactions(name, level, id, type) Task: Find salary from customers where salary exceeds the total value from transactions for the same code. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01389
train
v2
Schema: schedules (alias: schd)(value, date, type, code) requests(status, amount, level, name) Task: Find amount from schedules where a matching record exists in requests with the same code. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01390
train
v2
Schema: sales (alias: sale)(code, type, value, amount) schedules(type, date, amount, status) Task: Find value from sales where a matching record exists in schedules with the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01391
train
v1
Schema: sales (alias: sale)(status, value, salary, date) schedules(salary, name, id, value) Task: Select name from sales where id exists in schedules for the same status. SQL:
SELECT name FROM sales AS sale WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01392
train
v1
Schema: projects (alias: prj)(level, salary, id, value) items(date, level, id, amount) Task: Retrieve code from projects whose level is found in items rows where code matches the outer record. SQL:
SELECT code FROM projects AS prj WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01393
train
v1
Schema: categories (alias: catg)(status, value, id, amount) transactions(date, id, amount, name) Task: Find name from categories where code appears in transactions entries with matching type. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01394
train
v1
Schema: products (alias: prod)(amount, date, salary, id) requests(date, id, code, name) Task: Retrieve salary from products whose status is found in requests rows where code matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01395
train
v2
Schema: sales (alias: sale)(value, amount, status, code) schedules(code, type, date, status) Task: Find name from sales where a matching record exists in schedules with 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_01396
train
v1
Schema: invoices (alias: inv)(value, date, level, code) schedules(date, salary, name, code) Task: Retrieve amount from invoices whose id is found in schedules rows where status matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01397
train
v1
Schema: invoices (alias: inv)(value, type, date, id) customers(id, amount, value, name) Task: Retrieve code from invoices whose status is found in customers rows where type matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01398
train
v2
Schema: managers (alias: mgr)(level, date, id, name) departments(salary, id, date, name) Task: Retrieve id from managers that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01399
train