variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: branches (alias: brc)(type, level, code, id) orders(code, status, salary, level) Task: Find amount from branches where a matching record exists in orders with the same type. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = brc.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04400
train
v3
Schema: schedules (alias: schd)(date, name, type, status) tasks(status, name, value, date) Task: Find amount from schedules where value exceeds the average value from tasks for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.code = schd.code );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04401
train
v1
Schema: regions (alias: rgn)(level, name, salary, type) shipments(name, level, type, amount) Task: Select value from regions where code exists in shipments for the same code. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code 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": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04402
train
v2
Schema: products (alias: prod)(id, status, salary, name) requests(code, amount, level, value) Task: Retrieve id from products that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04403
train
v1
Schema: sales (alias: sale)(code, amount, salary, level) categories(id, date, name, amount) Task: Retrieve id from sales whose code is found in categories rows where status matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = sale.status );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04404
train
v1
Schema: employees (alias: emp)(type, name, date, amount) invoices(date, id, code, salary) Task: Find amount from employees where id appears in invoices entries with matching code. SQL:
SELECT amount FROM employees AS emp WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.code = emp.code );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04405
train
v1
Schema: sales (alias: sale)(code, value, name, salary) staff(code, id, date, value) Task: Select value from sales where id exists in staff for the same code. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id 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": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04406
train
v3
Schema: shipments (alias: shp)(level, date, salary, name) staff(salary, type, id, level) Task: Find name from shipments where amount exceeds the minimum salary from staff for the same type. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04407
train
v3
Schema: branches (alias: brc)(name, amount, level, status) projects(amount, status, type, id) Task: Retrieve name from branches with salary above the AVG(salary) of projects rows sharing the same id. SQL:
SELECT name FROM branches AS brc WHERE salary > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.id = brc.id );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04408
train
v1
Schema: transactions (alias: txn)(name, type, value, code) items(type, name, date, status) Task: Find value from transactions where status appears in items entries with matching type. SQL:
SELECT value FROM transactions AS txn WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = txn.type );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04409
train
v1
Schema: schedules (alias: schd)(type, id, status, amount) items(level, amount, value, date) Task: Retrieve name from schedules whose status is found in items rows where code matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04410
train
v1
Schema: shipments (alias: shp)(code, type, salary, value) orders(level, id, date, salary) Task: Retrieve salary from shipments whose status is found in orders rows where type matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04411
train
v3
Schema: transactions (alias: txn)(code, salary, level, type) orders(date, amount, salary, value) Task: Retrieve amount from transactions with amount above the COUNT(value) of orders rows sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04412
train
v2
Schema: transactions (alias: txn)(value, name, salary, status) sales(date, value, code, salary) Task: Retrieve amount from transactions that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04413
train
v1
Schema: staff (alias: empl)(status, code, date, name) products(salary, amount, type, date) Task: Retrieve salary from staff whose code is found in products rows where type matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = empl.type );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04414
train
v3
Schema: departments (alias: dept)(value, name, id, type) customers(amount, value, code, id) Task: Find salary from departments where amount exceeds the minimum salary from customers for the same type. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = dept.type );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04415
train
v2
Schema: orders (alias: ord)(code, value, status, name) shipments(status, value, id, date) Task: Find code from orders where a matching record exists in shipments with the same id. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04416
train
v3
Schema: sales (alias: sale)(amount, code, name, type) branches(id, date, status, amount) Task: Find code from sales where amount exceeds the total value from branches for the same type. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM branches AS brc WHERE brc.type = sale.type );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04417
train
v1
Schema: departments (alias: dept)(date, status, name, salary) items(code, salary, status, type) Task: Retrieve id from departments whose id is found in items rows where code matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04418
train
v3
Schema: invoices (alias: inv)(name, code, type, status) projects(name, id, value, date) Task: Retrieve id from invoices with value above the COUNT(salary) of projects rows sharing the same id. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.id = inv.id );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04419
train
v1
Schema: accounts (alias: acct)(value, date, amount, name) managers(date, id, code, status) Task: Select salary from accounts where code exists in managers for the same status. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04420
train
v2
Schema: items (alias: lne)(status, date, level, type) regions(date, salary, type, name) Task: Retrieve id from items that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04421
train
v1
Schema: managers (alias: mgr)(value, code, amount, id) invoices(id, name, date, level) Task: Select amount from managers where code exists in invoices for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = mgr.id );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04422
train
v1
Schema: tasks (alias: tsk)(value, type, salary, code) schedules(id, type, salary, name) Task: Find name from tasks where code appears in schedules entries with matching type. SQL:
SELECT name FROM tasks AS tsk WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04423
train
v2
Schema: schedules (alias: schd)(code, status, type, amount) accounts(level, salary, amount, type) Task: Find id from schedules where a matching record exists in accounts with the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = schd.level );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04424
train
v3
Schema: items (alias: lne)(name, code, id, type) departments(name, salary, date, id) Task: Retrieve code from items with value above the AVG(salary) of departments rows sharing the same id. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04425
train
v3
Schema: products (alias: prod)(salary, id, type, status) schedules(status, salary, id, level) Task: Find value from products where amount exceeds the average salary from schedules for the same type. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04426
train
v3
Schema: transactions (alias: txn)(value, level, type, id) staff(type, name, date, code) Task: Retrieve amount from transactions with amount above the AVG(value) of staff rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM staff AS empl WHERE empl.code = txn.code );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04427
train
v2
Schema: branches (alias: brc)(value, type, status, date) schedules(date, level, id, salary) Task: Retrieve name from branches that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = brc.type );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04428
train
v1
Schema: managers (alias: mgr)(id, code, salary, type) schedules(type, value, code, date) Task: Select code from managers where type exists in schedules for the same status. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04429
train
v3
Schema: staff (alias: empl)(code, id, value, level) categories(code, level, amount, date) Task: Retrieve value from staff with salary above the SUM(amount) of categories rows sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04430
train
v3
Schema: accounts (alias: acct)(name, code, type, id) orders(code, date, level, name) Task: Retrieve code from accounts with salary above the SUM(amount) of orders rows sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04431
train
v3
Schema: transactions (alias: txn)(code, salary, id, level) sales(date, code, amount, value) Task: Retrieve amount from transactions with value above the MAX(value) of sales rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04432
train
v3
Schema: managers (alias: mgr)(date, type, status, amount) categories(id, type, amount, name) Task: Find amount from managers where value exceeds the average value from categories for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04433
train
v2
Schema: categories (alias: catg)(status, code, name, date) products(id, type, salary, date) Task: Retrieve name from categories that have at least one corresponding entry in products sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04434
train
v2
Schema: schedules (alias: schd)(date, value, name, code) employees(amount, status, level, value) Task: Find code from schedules where a matching record exists in employees with the same type. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04435
train
v1
Schema: regions (alias: rgn)(code, level, status, date) branches(level, id, code, name) Task: Select id from regions where code exists in branches for the same code. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04436
train
v3
Schema: products (alias: prod)(salary, id, code, value) branches(salary, name, value, level) Task: Retrieve salary from products with amount above the MIN(amount) of branches rows sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.type = prod.type );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04437
train
v3
Schema: schedules (alias: schd)(level, status, type, salary) departments(type, amount, value, name) Task: Retrieve code from schedules with amount above the MAX(amount) of departments rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.level = schd.level );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04438
train
v1
Schema: invoices (alias: inv)(status, salary, level, id) managers(date, value, status, level) Task: Retrieve amount from invoices whose code is found in managers rows where type matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04439
train
v1
Schema: categories (alias: catg)(value, type, date, code) departments(level, salary, id, status) Task: Find amount from categories where code appears in departments entries with matching code. SQL:
SELECT amount FROM categories AS catg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04440
train
v3
Schema: customers (alias: cust)(value, code, status, name) regions(name, type, status, level) Task: Find amount from customers where value exceeds the count of salary from regions for the same level. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04441
train
v2
Schema: staff (alias: empl)(amount, type, level, date) branches(date, name, amount, salary) Task: Retrieve code from staff that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = empl.status );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04442
train
v2
Schema: accounts (alias: acct)(date, status, id, amount) schedules(name, status, value, amount) Task: Find name from accounts where a matching record exists in schedules with the same level. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = acct.level );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04443
train
v2
Schema: orders (alias: ord)(amount, name, type, level) branches(type, code, status, id) Task: Retrieve amount from orders that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = ord.code );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "amount", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04444
train
v2
Schema: branches (alias: brc)(date, name, value, type) sales(level, salary, type, amount) Task: Find id from branches where a matching record exists in sales with the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = brc.type );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04445
train
v3
Schema: requests (alias: ordr)(id, code, type, value) products(date, id, amount, code) Task: Find code from requests where salary exceeds the count of salary from products for the same level. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04446
train
v3
Schema: accounts (alias: acct)(id, amount, code, date) transactions(salary, id, name, date) Task: Retrieve value from accounts with value above the AVG(value) of transactions rows sharing the same level. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04447
train
v1
Schema: managers (alias: mgr)(id, name, salary, amount) employees(id, value, status, type) Task: Retrieve name from managers whose id is found in employees rows where code matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04448
train
v1
Schema: orders (alias: ord)(level, type, id, value) branches(code, id, salary, name) Task: Select id from orders where id exists in branches for the same level. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.level = ord.level );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04449
train
v1
Schema: customers (alias: cust)(salary, name, date, level) projects(value, date, id, amount) Task: Retrieve value from customers whose code is found in projects rows where code matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04450
train
v3
Schema: regions (alias: rgn)(id, date, name, salary) schedules(type, value, salary, code) Task: Find value from regions where value exceeds the count of value from schedules for the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04451
train
v1
Schema: sales (alias: sale)(name, date, value, code) invoices(date, name, code, status) Task: Retrieve salary from sales whose status is found in invoices rows where level matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04452
train
v1
Schema: projects (alias: prj)(amount, id, date, name) branches(code, status, amount, level) Task: Retrieve amount from projects whose status is found in branches rows where level matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04453
train
v3
Schema: categories (alias: catg)(id, type, date, amount) accounts(date, status, value, salary) Task: Find id from categories where amount exceeds the minimum value from accounts for the same status. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.status = catg.status );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04454
train
v1
Schema: orders (alias: ord)(id, amount, type, value) items(value, type, id, status) Task: Retrieve code from orders whose level is found in items rows where code matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = ord.code );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04455
train
v1
Schema: schedules (alias: schd)(id, name, type, level) items(value, name, salary, code) Task: Retrieve salary from schedules whose type is found in items rows where status matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04456
train
v1
Schema: products (alias: prod)(level, name, date, type) invoices(code, status, name, date) Task: Select name from products where type exists in invoices for the same id. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04457
train
v3
Schema: products (alias: prod)(salary, value, name, id) transactions(value, amount, level, name) Task: Find amount from products where amount exceeds the average salary from transactions for the same id. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04458
train
v2
Schema: accounts (alias: acct)(date, id, salary, type) regions(value, salary, status, id) Task: Find amount from accounts where a matching record exists in regions with the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04459
train
v3
Schema: categories (alias: catg)(date, amount, level, code) projects(salary, name, level, amount) Task: Find amount from categories where value exceeds the minimum amount from projects for the same type. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.type = catg.type );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04460
train
v2
Schema: orders (alias: ord)(type, date, amount, salary) employees(id, level, value, amount) Task: Retrieve amount from orders that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = ord.type );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04461
train
v1
Schema: invoices (alias: inv)(name, code, date, level) products(date, status, type, level) Task: Find name from invoices where type appears in products entries with matching status. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = inv.status );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04462
train
v1
Schema: customers (alias: cust)(name, type, amount, id) accounts(level, id, name, status) Task: Retrieve value from customers whose id is found in accounts rows where level matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04463
train
v1
Schema: items (alias: lne)(value, salary, name, id) accounts(name, value, id, amount) Task: Select code from items where level exists in accounts for the same type. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04464
train
v3
Schema: transactions (alias: txn)(value, id, type, date) accounts(type, name, value, amount) Task: Retrieve name from transactions with value above the AVG(value) of accounts rows sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04465
train
v3
Schema: requests (alias: ordr)(status, id, code, name) accounts(id, code, name, amount) Task: Find value from requests where salary exceeds the maximum value from accounts for the same level. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04466
train
v2
Schema: departments (alias: dept)(level, status, salary, date) branches(amount, status, code, date) Task: Retrieve id from departments that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = dept.type );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04467
train
v1
Schema: tasks (alias: tsk)(code, type, level, status) invoices(status, name, value, level) Task: Find id from tasks where code appears in invoices entries with matching level. SQL:
SELECT id FROM tasks AS tsk WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04468
train
v1
Schema: invoices (alias: inv)(id, salary, value, level) departments(value, name, code, level) Task: Find id from invoices where code appears in departments entries with matching type. SQL:
SELECT id FROM invoices AS inv WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = inv.type );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04469
train
v1
Schema: customers (alias: cust)(salary, id, status, date) transactions(code, value, status, id) Task: Select name from customers where status exists in transactions for the same id. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04470
train
v3
Schema: employees (alias: emp)(code, status, type, name) invoices(amount, name, type, status) Task: Find id from employees where value exceeds the average salary from invoices for the same code. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.code = emp.code );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04471
train
v3
Schema: branches (alias: brc)(status, id, value, date) projects(value, type, code, level) Task: Find id from branches where value exceeds the average salary from projects for the same id. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.id = brc.id );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04472
train
v2
Schema: tasks (alias: tsk)(id, salary, value, type) staff(id, name, code, status) Task: Find amount from tasks where a matching record exists in staff with the same type. SQL:
SELECT amount 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": "amount", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04473
train
v1
Schema: employees (alias: emp)(type, value, level, salary) products(code, status, type, level) Task: Select code from employees where code exists in products for the same code. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = emp.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04474
train
v2
Schema: invoices (alias: inv)(date, level, code, value) sales(date, name, salary, code) Task: Retrieve code from invoices that have at least one corresponding entry in sales sharing 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_04475
train
v3
Schema: invoices (alias: inv)(status, type, id, date) staff(name, status, amount, level) Task: Retrieve amount from invoices with amount above the MAX(value) of staff rows sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MAX(value) FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04476
train
v3
Schema: customers (alias: cust)(amount, date, code, name) schedules(status, value, id, level) Task: Find code from customers where salary exceeds the minimum salary from schedules for the same type. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04477
train
v3
Schema: branches (alias: brc)(name, id, level, value) staff(amount, code, id, level) Task: Find salary from branches where value exceeds the maximum value from staff for the same level. SQL:
SELECT salary FROM branches AS brc WHERE value > ( SELECT MAX(value) FROM staff AS empl WHERE empl.level = brc.level );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04478
train
v2
Schema: requests (alias: ordr)(amount, value, date, salary) invoices(id, value, type, date) Task: Retrieve code from requests that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04479
train
v2
Schema: customers (alias: cust)(date, id, code, name) accounts(salary, amount, type, name) Task: Find salary from customers where a matching record exists in accounts with the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04480
train
v1
Schema: sales (alias: sale)(value, status, name, id) branches(value, name, date, code) Task: Select amount from sales where id exists in branches for the same type. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = sale.type );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04481
train
v3
Schema: shipments (alias: shp)(id, code, level, value) requests(level, date, name, value) Task: Retrieve code from shipments with salary above the MIN(value) of requests rows sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04482
train
v3
Schema: employees (alias: emp)(type, level, name, status) invoices(id, date, value, salary) Task: Retrieve id from employees with amount above the MIN(amount) of invoices rows sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.type = emp.type );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04483
train
v1
Schema: departments (alias: dept)(code, amount, id, salary) tasks(code, name, status, salary) Task: Find amount from departments where id appears in tasks entries with matching level. SQL:
SELECT amount FROM departments AS dept WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = dept.level );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04484
train
v3
Schema: items (alias: lne)(name, date, id, status) tasks(status, value, name, code) Task: Find amount from items where amount exceeds the average value from tasks for the same id. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.id = lne.id );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04485
train
v3
Schema: sales (alias: sale)(name, status, salary, amount) shipments(level, amount, date, code) Task: Find id from sales where value exceeds the total value from shipments for the same code. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04486
train
v3
Schema: categories (alias: catg)(status, value, date, name) employees(name, type, value, amount) Task: Find salary from categories where salary exceeds the maximum salary from employees for the same level. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.level = catg.level );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04487
train
v2
Schema: customers (alias: cust)(name, salary, status, value) requests(name, level, status, type) Task: Find value from customers where a matching record exists in requests with the same code. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04488
train
v2
Schema: sales (alias: sale)(id, code, name, status) accounts(status, id, date, type) Task: Retrieve salary from sales that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04489
train
v3
Schema: orders (alias: ord)(date, code, type, value) staff(value, name, date, status) Task: Find name from orders where value exceeds the total value from staff for the same code. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT SUM(value) FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04490
train
v3
Schema: schedules (alias: schd)(value, date, amount, level) departments(type, salary, date, id) Task: Find id from schedules where amount exceeds the minimum amount from departments for the same level. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.level = schd.level );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04491
train
v2
Schema: orders (alias: ord)(value, id, type, name) schedules(id, amount, type, salary) Task: Find salary from orders where a matching record exists in schedules with the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04492
train
v3
Schema: categories (alias: catg)(amount, date, id, code) products(level, amount, code, salary) Task: Find value from categories where amount exceeds the count of value from products for the same level. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.level = catg.level );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04493
train
v2
Schema: managers (alias: mgr)(code, type, date, id) projects(code, date, value, name) Task: Find amount from managers where a matching record exists in projects with the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = mgr.status );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04494
train
v1
Schema: managers (alias: mgr)(value, salary, date, type) employees(id, amount, code, name) Task: Select value from managers where id exists in employees for the same status. SQL:
SELECT value FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04495
train
v2
Schema: transactions (alias: txn)(name, type, code, amount) managers(level, amount, status, salary) Task: Retrieve code from transactions that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04496
train
v2
Schema: categories (alias: catg)(salary, level, code, type) regions(amount, type, level, status) Task: Find value from categories where a matching record exists in regions with the same code. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = catg.code );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04497
train
v1
Schema: branches (alias: brc)(value, status, salary, level) items(date, type, level, id) Task: Retrieve salary from branches whose status is found in items rows where status matches the outer record. SQL:
SELECT salary FROM branches AS brc WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = brc.status );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04498
train
v2
Schema: transactions (alias: txn)(id, type, status, level) branches(id, name, type, code) Task: Retrieve salary from transactions that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "salary", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04499
train