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: transactions (alias: txn)(date, id, amount, level) tasks(amount, level, type, date) Task: Select id from transactions where id exists in tasks for the same level. SQL:
SELECT id FROM transactions AS txn WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = txn.level );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01500
train
v1
Schema: branches (alias: brc)(date, name, code, amount) transactions(id, name, type, code) Task: Find id from branches where type appears in transactions entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = brc.code );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01501
train
v3
Schema: tasks (alias: tsk)(id, name, level, value) projects(status, salary, name, amount) Task: Retrieve amount from tasks with amount above the AVG(salary) of projects rows sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE amount > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01502
train
v1
Schema: projects (alias: prj)(amount, salary, date, code) invoices(level, id, value, date) Task: Retrieve amount from projects whose code is found in invoices rows where id matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = prj.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01503
train
v2
Schema: regions (alias: rgn)(salary, type, code, status) items(code, level, status, value) Task: Find id from regions where a matching record exists in items with the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01504
train
v3
Schema: customers (alias: cust)(amount, date, value, salary) invoices(id, type, date, amount) Task: Find amount from customers where salary exceeds the average salary from invoices for the same id. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01505
train
v2
Schema: requests (alias: ordr)(amount, name, status, id) invoices(value, id, status, code) Task: Retrieve amount from requests that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount 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": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01506
train
v1
Schema: schedules (alias: schd)(level, name, amount, value) requests(amount, date, status, type) Task: Find name from schedules where id appears in requests entries with matching code. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01507
train
v2
Schema: customers (alias: cust)(id, code, value, amount) departments(code, salary, id, date) Task: Retrieve name from customers that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = cust.level );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01508
train
v3
Schema: accounts (alias: acct)(value, type, id, salary) transactions(id, name, level, status) Task: Find amount from accounts where salary exceeds the maximum amount from transactions for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01509
train
v1
Schema: regions (alias: rgn)(status, salary, value, amount) requests(salary, name, type, id) Task: Retrieve name from regions whose type is found in requests rows where level matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01510
train
v2
Schema: schedules (alias: schd)(code, status, level, salary) departments(type, value, amount, id) Task: Retrieve amount from schedules that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01511
train
v3
Schema: branches (alias: brc)(code, type, salary, status) employees(type, amount, name, level) Task: Find salary from branches where amount exceeds the total amount from employees for the same id. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.id = brc.id );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01512
train
v1
Schema: schedules (alias: schd)(amount, level, status, type) projects(name, status, amount, level) Task: Retrieve amount from schedules whose code is found in projects rows where type matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = schd.type );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01513
train
v1
Schema: invoices (alias: inv)(level, date, value, salary) requests(name, value, status, type) Task: Find amount from invoices where level appears in requests entries with matching type. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01514
train
v2
Schema: projects (alias: prj)(code, id, amount, name) departments(value, date, salary, code) Task: Find name from projects where a matching record exists in departments with the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = prj.id );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01515
train
v2
Schema: invoices (alias: inv)(status, type, name, salary) customers(date, level, id, name) Task: Retrieve amount from invoices that have at least one corresponding entry in customers sharing 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_01516
train
v2
Schema: accounts (alias: acct)(id, level, type, code) regions(name, level, status, date) Task: Retrieve id from accounts that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01517
train
v1
Schema: customers (alias: cust)(name, type, status, code) orders(salary, value, date, level) Task: Select code from customers where level exists in orders for the same type. SQL:
SELECT code FROM customers AS cust WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01518
train
v3
Schema: tasks (alias: tsk)(date, amount, status, code) customers(id, name, status, amount) Task: Find salary from tasks where amount exceeds the total value from customers for the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE amount > ( SELECT SUM(value) FROM customers AS cust WHERE cust.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01519
train
v3
Schema: regions (alias: rgn)(id, type, level, salary) tasks(salary, level, status, code) Task: Find salary from regions where value exceeds the minimum salary from tasks for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.type = rgn.type );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01520
train
v1
Schema: projects (alias: prj)(status, name, salary, code) shipments(value, type, date, name) Task: Select code from projects where type exists in shipments for the same code. SQL:
SELECT code FROM projects AS prj WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = prj.code );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01521
train
v3
Schema: orders (alias: ord)(status, name, id, salary) invoices(amount, id, code, value) Task: Retrieve code from orders with amount above the MAX(value) of invoices rows sharing the same type. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01522
train
v1
Schema: customers (alias: cust)(status, code, id, name) departments(type, amount, name, salary) Task: Find value from customers where level appears in departments entries with matching id. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = cust.id );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01523
train
v2
Schema: branches (alias: brc)(amount, id, date, code) customers(level, status, code, date) Task: Find id from branches where a matching record exists in customers with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = brc.code );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01524
train
v1
Schema: transactions (alias: txn)(salary, id, date, status) orders(date, id, level, type) Task: Select name from transactions where status exists in orders for the same level. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01525
train
v1
Schema: regions (alias: rgn)(id, type, status, amount) products(name, date, value, type) Task: Select value from regions where status exists in products for the same id. SQL:
SELECT value FROM regions AS rgn WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = rgn.id );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01526
train
v2
Schema: regions (alias: rgn)(status, id, value, code) categories(amount, type, status, name) Task: Find salary from regions where a matching record exists in categories with the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = rgn.type );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01527
train
v3
Schema: accounts (alias: acct)(status, type, level, date) employees(status, value, level, name) Task: Find code from accounts where value exceeds the average salary from employees for the same code. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01528
train
v1
Schema: invoices (alias: inv)(level, status, amount, date) shipments(salary, code, type, status) Task: Find salary from invoices where id appears in shipments entries with matching type. SQL:
SELECT salary FROM invoices AS inv WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01529
train
v1
Schema: schedules (alias: schd)(level, code, date, id) requests(amount, code, level, value) Task: Select id from schedules where level exists in requests for the same status. SQL:
SELECT id FROM schedules AS schd WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01530
train
v2
Schema: requests (alias: ordr)(type, amount, id, value) projects(code, salary, status, type) Task: Retrieve value from requests that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01531
train
v3
Schema: requests (alias: ordr)(code, name, value, amount) invoices(type, date, amount, level) Task: Retrieve value from requests with value above the MIN(value) of invoices rows sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01532
train
v2
Schema: categories (alias: catg)(status, type, id, name) customers(date, status, amount, type) Task: Retrieve id from categories that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01533
train
v2
Schema: categories (alias: catg)(amount, status, type, date) branches(status, amount, code, level) Task: Find id from categories where a matching record exists in branches with the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = catg.code );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01534
train
v3
Schema: transactions (alias: txn)(date, amount, level, type) projects(date, amount, level, name) Task: Retrieve salary from transactions with salary above the MIN(salary) of projects rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01535
train
v1
Schema: departments (alias: dept)(value, level, date, amount) items(type, status, level, value) Task: Find salary from departments where type appears in items entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01536
train
v1
Schema: branches (alias: brc)(status, name, value, amount) tasks(status, amount, salary, code) Task: Retrieve id from branches whose type is found in tasks rows where level matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = brc.level );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01537
train
v1
Schema: staff (alias: empl)(value, amount, code, name) sales(date, name, status, id) Task: Select code from staff where level exists in sales for the same id. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01538
train
v2
Schema: tasks (alias: tsk)(code, level, date, amount) categories(name, code, level, id) Task: Find code from tasks where a matching record exists in categories with the same type. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01539
train
v1
Schema: items (alias: lne)(type, id, date, salary) customers(type, value, amount, salary) Task: Retrieve value from items whose code is found in customers rows where type matches the outer record. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01540
train
v1
Schema: products (alias: prod)(name, type, code, id) accounts(level, name, type, salary) Task: Find id from products where level appears in accounts entries with matching code. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01541
train
v2
Schema: sales (alias: sale)(level, salary, name, amount) projects(amount, value, level, status) Task: Retrieve name from sales that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01542
train
v3
Schema: sales (alias: sale)(code, amount, name, salary) categories(value, status, date, code) Task: Retrieve amount from sales with value above the MAX(value) of categories rows sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01543
train
v1
Schema: schedules (alias: schd)(level, code, date, amount) regions(name, status, code, value) Task: Retrieve amount from schedules whose level is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01544
train
v1
Schema: staff (alias: empl)(status, code, name, level) departments(date, id, value, level) Task: Select amount from staff where status exists in departments for the same type. SQL:
SELECT amount FROM staff AS empl WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = empl.type );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01545
train
v3
Schema: projects (alias: prj)(amount, id, code, type) invoices(level, code, id, status) Task: Retrieve code from projects with amount above the MAX(value) of invoices rows sharing the same id. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.id = prj.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01546
train
v1
Schema: categories (alias: catg)(salary, level, date, name) branches(salary, amount, type, date) Task: Retrieve code from categories whose code is found in branches rows where id matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = catg.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01547
train
v2
Schema: transactions (alias: txn)(id, value, date, salary) managers(id, code, status, date) Task: Find name from transactions where a matching record exists in managers with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01548
train
v2
Schema: products (alias: prod)(status, code, salary, value) sales(code, date, status, salary) Task: Find name from products where a matching record exists in sales with the same level. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01549
train
v3
Schema: employees (alias: emp)(type, salary, name, value) managers(code, id, level, name) Task: Find value from employees where amount exceeds the total salary from managers for the same type. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.type = emp.type );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01550
train
v1
Schema: orders (alias: ord)(status, id, code, level) projects(value, code, salary, type) Task: Find name from orders where id appears in projects entries with matching type. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.type = ord.type );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01551
train
v2
Schema: regions (alias: rgn)(id, name, date, level) invoices(value, salary, amount, type) Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01552
train
v3
Schema: staff (alias: empl)(value, date, name, id) sales(date, name, amount, type) Task: Find name from staff where value exceeds the maximum value from sales for the same level. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01553
train
v1
Schema: staff (alias: empl)(status, salary, id, type) departments(status, salary, value, name) Task: Select amount from staff where code exists in departments for the same type. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = empl.type );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01554
train
v2
Schema: branches (alias: brc)(status, value, id, code) staff(id, amount, type, level) Task: Retrieve salary from branches that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = brc.level );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "salary", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01555
train
v3
Schema: categories (alias: catg)(id, value, type, status) items(name, type, level, amount) Task: Retrieve value from categories with salary above the COUNT(amount) of items rows sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01556
train
v3
Schema: accounts (alias: acct)(amount, date, level, name) customers(salary, id, value, level) Task: Find code from accounts where amount exceeds the minimum salary from customers for the same type. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01557
train
v3
Schema: departments (alias: dept)(id, date, salary, value) branches(code, salary, date, type) Task: Retrieve salary from departments with salary above the COUNT(salary) of branches rows sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01558
train
v3
Schema: employees (alias: emp)(date, type, amount, level) schedules(id, status, name, type) Task: Find name from employees where salary exceeds the average salary from schedules for the same level. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01559
train
v2
Schema: departments (alias: dept)(salary, amount, id, level) orders(status, code, amount, date) Task: Find id from departments where a matching record exists in orders with the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01560
train
v2
Schema: transactions (alias: txn)(status, level, id, salary) invoices(status, type, salary, amount) Task: Find value from transactions where a matching record exists in invoices with the same status. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01561
train
v2
Schema: requests (alias: ordr)(level, type, value, status) tasks(id, amount, date, name) Task: Find code from requests where a matching record exists in tasks with the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = ordr.status );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_01562
train
v3
Schema: items (alias: lne)(amount, salary, type, date) products(name, id, salary, value) Task: Find value from items where value exceeds the total amount from products for the same type. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01563
train
v3
Schema: tasks (alias: tsk)(value, name, date, status) categories(salary, date, code, amount) Task: Retrieve id from tasks with salary above the MAX(amount) of categories rows sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_01564
train
v3
Schema: projects (alias: prj)(level, date, name, type) transactions(code, id, level, type) Task: Retrieve name from projects with salary above the SUM(amount) of transactions rows sharing the same level. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01565
train
v2
Schema: schedules (alias: schd)(id, value, date, name) branches(amount, id, date, code) Task: Find amount from schedules where a matching record exists in branches with the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01566
train
v2
Schema: shipments (alias: shp)(date, type, salary, level) managers(code, id, amount, value) Task: Find name from shipments where a matching record exists in managers with the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01567
train
v1
Schema: regions (alias: rgn)(code, id, date, value) schedules(code, name, status, date) Task: Find code from regions where code appears in schedules entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01568
train
v3
Schema: departments (alias: dept)(type, level, amount, name) tasks(value, type, level, code) Task: Find salary from departments where salary exceeds the minimum amount from tasks for the same status. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.status = dept.status );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01569
train
v2
Schema: sales (alias: sale)(amount, salary, code, status) products(amount, type, date, value) Task: Retrieve id from sales that have at least one corresponding entry in products sharing the same code. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = sale.code );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01570
train
v1
Schema: invoices (alias: inv)(level, date, value, name) customers(type, name, id, amount) Task: Select salary from invoices where code exists in customers for the same id. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01571
train
v2
Schema: accounts (alias: acct)(type, code, salary, value) regions(id, amount, date, code) Task: Retrieve code from accounts that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01572
train
v3
Schema: branches (alias: brc)(date, value, name, type) schedules(type, code, salary, level) Task: Retrieve value from branches with value above the COUNT(salary) of schedules rows sharing the same code. SQL:
SELECT value FROM branches AS brc WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01573
train
v2
Schema: orders (alias: ord)(value, id, status, salary) items(type, amount, status, date) Task: Find salary from orders where a matching record exists in items with the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01574
train
v2
Schema: shipments (alias: shp)(level, value, status, date) transactions(level, amount, status, salary) Task: Retrieve code from shipments that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_01575
train
v3
Schema: departments (alias: dept)(code, type, date, value) products(id, value, type, amount) Task: Find code from departments where value exceeds the minimum value from products for the same type. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01576
train
v3
Schema: employees (alias: emp)(date, type, status, name) branches(code, date, status, salary) Task: Find salary from employees where value exceeds the maximum salary from branches for the same id. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.id = emp.id );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01577
train
v2
Schema: items (alias: lne)(id, code, status, type) customers(type, value, date, id) Task: Find name from items where a matching record exists in customers with the same status. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = lne.status );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01578
train
v2
Schema: branches (alias: brc)(amount, status, code, level) employees(level, amount, value, name) Task: Find code from branches where a matching record exists in employees with the same status. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = brc.status );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01579
train
v3
Schema: employees (alias: emp)(value, name, date, id) requests(name, salary, status, level) Task: Find code from employees where value exceeds the average salary from requests for the same id. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.id = emp.id );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01580
train
v1
Schema: categories (alias: catg)(date, name, amount, type) projects(id, amount, date, code) Task: Retrieve salary from categories whose id is found in projects rows where status matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.status = catg.status );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01581
train
v1
Schema: products (alias: prod)(status, level, value, type) sales(id, level, type, status) Task: Select value from products where level exists in sales for the same code. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01582
train
v3
Schema: schedules (alias: schd)(type, value, level, id) sales(level, amount, date, value) Task: Find name from schedules where amount exceeds the average salary from sales for the same status. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.status = schd.status );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01583
train
v3
Schema: staff (alias: empl)(amount, code, type, value) invoices(code, amount, type, date) Task: Retrieve amount from staff with salary above the MAX(value) of invoices rows sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_01584
train
v1
Schema: invoices (alias: inv)(status, value, date, id) regions(amount, salary, date, status) Task: Retrieve amount from invoices whose code is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01585
train
v2
Schema: items (alias: lne)(level, value, amount, date) managers(salary, name, date, level) Task: Retrieve id from items that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_01586
train
v2
Schema: sales (alias: sale)(name, id, type, date) categories(name, amount, id, value) Task: Find salary from sales where a matching record exists in categories with the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = sale.code );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01587
train
v2
Schema: customers (alias: cust)(level, id, date, name) branches(level, salary, value, id) Task: Find value from customers where a matching record exists in branches with the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = cust.status );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01588
train
v3
Schema: categories (alias: catg)(level, code, status, amount) shipments(date, value, level, id) Task: Find code from categories where value exceeds the average value from shipments for the same code. SQL:
SELECT code FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01589
train
v1
Schema: managers (alias: mgr)(amount, type, status, value) branches(date, level, name, code) Task: Find amount from managers where code appears in branches entries with matching level. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.level = mgr.level );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01590
train
v3
Schema: transactions (alias: txn)(type, amount, code, status) categories(name, status, salary, code) Task: Retrieve name from transactions with salary above the AVG(value) of categories rows sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( 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": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01591
train
v3
Schema: sales (alias: sale)(id, code, name, type) requests(salary, name, level, code) Task: Find amount from sales where value exceeds the minimum salary from requests for the same level. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01592
train
v3
Schema: projects (alias: prj)(amount, status, type, value) employees(value, status, id, name) Task: Find amount from projects where salary exceeds the count of salary from employees for the same id. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.id = prj.id );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_01593
train
v3
Schema: orders (alias: ord)(id, type, amount, status) departments(type, salary, value, status) Task: Find id from orders where value exceeds the maximum salary from departments for the same type. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.type = ord.type );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01594
train
v1
Schema: sales (alias: sale)(status, date, type, level) departments(value, level, id, salary) Task: Retrieve code from sales whose level is found in departments rows where status matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01595
train
v2
Schema: branches (alias: brc)(value, status, date, id) managers(type, salary, id, name) Task: Find amount from branches where a matching record exists in managers with the same level. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = brc.level );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_01596
train
v1
Schema: schedules (alias: schd)(value, amount, date, salary) items(date, status, salary, name) Task: Find value from schedules where level appears in items entries with matching status. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_01597
train
v3
Schema: managers (alias: mgr)(name, id, value, code) sales(level, code, id, date) Task: Retrieve code from managers with value above the COUNT(salary) of sales rows sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_01598
train
v2
Schema: regions (alias: rgn)(level, name, type, amount) branches(level, name, amount, code) Task: Retrieve name from regions that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = rgn.type );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_01599
train