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: requests (alias: ordr)(name, value, date, type) branches(status, name, type, amount) Task: Find id from requests where type appears in branches entries with matching code. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = ordr.code );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14600
train
v3
Schema: invoices (alias: inv)(value, id, status, name) accounts(status, date, code, salary) Task: Find value from invoices where amount exceeds the maximum amount from accounts for the same status. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14601
train
v1
Schema: requests (alias: ordr)(date, type, code, value) managers(name, type, level, date) Task: Find id from requests where status appears in managers entries with matching level. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14602
train
v1
Schema: regions (alias: rgn)(salary, level, date, type) tasks(name, type, amount, value) Task: Retrieve amount from regions whose code is found in tasks rows where id matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = rgn.id );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14603
train
v2
Schema: staff (alias: empl)(code, value, id, name) customers(status, salary, value, type) Task: Retrieve value from staff that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14604
train
v2
Schema: items (alias: lne)(id, value, amount, salary) branches(amount, type, value, level) Task: Retrieve amount from items that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = lne.code );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "amount", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14605
train
v1
Schema: projects (alias: prj)(salary, status, id, type) orders(value, date, name, salary) Task: Retrieve value from projects whose code is found in orders rows where id matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = prj.id );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14606
train
v3
Schema: departments (alias: dept)(value, code, level, status) regions(id, date, status, type) Task: Retrieve salary from departments with salary above the MIN(amount) of regions rows sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.level = dept.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14607
train
v3
Schema: managers (alias: mgr)(amount, date, code, level) tasks(id, type, amount, status) Task: Retrieve value from managers with salary above the AVG(amount) of tasks rows sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.type = mgr.type );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14608
train
v1
Schema: requests (alias: ordr)(value, code, name, id) customers(status, salary, name, id) Task: Retrieve code from requests whose type is found in customers rows where type matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = ordr.type );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14609
train
v1
Schema: schedules (alias: schd)(status, type, level, salary) tasks(salary, type, level, code) Task: Find salary from schedules where id appears in tasks entries with matching code. SQL:
SELECT salary FROM schedules AS schd WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = schd.code );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14610
train
v3
Schema: schedules (alias: schd)(code, level, date, id) departments(code, salary, value, name) Task: Find id from schedules where value exceeds the count of amount from departments for the same level. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT COUNT(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": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14611
train
v1
Schema: managers (alias: mgr)(status, level, value, type) customers(value, type, name, date) Task: Select name from managers where type exists in customers for the same id. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14612
train
v2
Schema: managers (alias: mgr)(type, status, salary, id) regions(code, salary, status, id) Task: Retrieve code from managers that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14613
train
v2
Schema: tasks (alias: tsk)(level, name, status, salary) employees(code, id, amount, level) Task: Retrieve id from tasks that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14614
train
v2
Schema: orders (alias: ord)(type, amount, value, id) departments(type, amount, date, status) Task: Retrieve name from orders that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14615
train
v3
Schema: invoices (alias: inv)(amount, salary, code, level) shipments(date, salary, value, code) Task: Find value from invoices where amount exceeds the minimum amount from shipments for the same code. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14616
train
v3
Schema: staff (alias: empl)(status, amount, salary, type) departments(type, amount, name, date) Task: Find value from staff where salary exceeds the maximum salary from departments for the same status. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14617
train
v1
Schema: regions (alias: rgn)(name, id, code, date) staff(salary, date, level, amount) Task: Retrieve code from regions whose type is found in staff rows where code matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14618
train
v3
Schema: regions (alias: rgn)(level, id, date, value) invoices(id, code, type, value) Task: Retrieve salary from regions with value above the MAX(value) of invoices rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14619
train
v1
Schema: regions (alias: rgn)(salary, status, level, name) projects(salary, status, value, code) Task: Retrieve salary from regions whose level is found in projects rows where type matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = rgn.type );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14620
train
v1
Schema: projects (alias: prj)(id, salary, date, value) orders(type, code, status, value) Task: Find name from projects where id appears in orders entries with matching code. SQL:
SELECT name FROM projects AS prj WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14621
train
v2
Schema: transactions (alias: txn)(code, date, name, value) tasks(salary, value, name, date) Task: Find value from transactions where a matching record exists in tasks with the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = txn.code );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14622
train
v3
Schema: shipments (alias: shp)(name, level, salary, type) staff(salary, type, date, name) Task: Retrieve id from shipments with amount above the COUNT(salary) of staff rows sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14623
train
v3
Schema: transactions (alias: txn)(salary, value, type, amount) orders(status, level, date, code) Task: Find name from transactions where value exceeds the maximum amount from orders for the same code. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14624
train
v3
Schema: employees (alias: emp)(level, value, code, date) invoices(salary, code, name, amount) Task: Retrieve amount from employees with salary above the AVG(value) of invoices rows sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT AVG(value) 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": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14625
train
v2
Schema: staff (alias: empl)(type, id, amount, date) sales(name, id, status, type) Task: Find salary from staff where a matching record exists in sales with the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = empl.status );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14626
train
v3
Schema: branches (alias: brc)(level, name, type, id) employees(code, salary, date, amount) Task: Retrieve amount from branches with value above the MAX(salary) of employees rows sharing the same code. SQL:
SELECT amount FROM branches AS brc WHERE value > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.code = brc.code );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14627
train
v2
Schema: customers (alias: cust)(level, date, salary, value) staff(code, id, status, value) Task: Retrieve salary from customers that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = cust.status );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14628
train
v3
Schema: accounts (alias: acct)(code, salary, date, amount) managers(id, status, value, date) Task: Retrieve code from accounts with salary above the SUM(amount) of managers rows sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "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_14629
train
v2
Schema: sales (alias: sale)(value, status, date, level) regions(salary, status, date, amount) Task: Retrieve code from sales that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14630
train
v3
Schema: orders (alias: ord)(status, name, amount, code) products(code, amount, salary, value) Task: Find salary from orders where salary exceeds the minimum salary from products for the same status. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM products AS prod WHERE prod.status = ord.status );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14631
train
v2
Schema: staff (alias: empl)(value, code, type, status) transactions(name, salary, type, value) Task: Retrieve id from staff that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = empl.code );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14632
train
v3
Schema: tasks (alias: tsk)(id, type, name, amount) branches(id, type, salary, value) Task: Find name from tasks where salary exceeds the minimum value from branches for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT MIN(value) FROM branches AS brc WHERE brc.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14633
train
v1
Schema: shipments (alias: shp)(level, value, type, code) departments(level, date, amount, code) Task: Select code from shipments where code exists in departments for the same code. SQL:
SELECT code FROM shipments AS shp WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_14634
train
v1
Schema: customers (alias: cust)(code, id, status, date) orders(status, type, salary, name) Task: Select code from customers where code exists in orders for the same code. SQL:
SELECT code FROM customers AS cust WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14635
train
v3
Schema: products (alias: prod)(status, code, amount, level) customers(value, code, type, date) Task: Retrieve id from products with amount above the MIN(salary) of customers rows sharing the same status. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14636
train
v1
Schema: categories (alias: catg)(amount, status, value, date) items(status, type, level, value) Task: Select salary from categories where code exists in items for the same level. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM items AS lne WHERE lne.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14637
train
v2
Schema: schedules (alias: schd)(id, code, amount, date) products(status, code, type, amount) Task: Find name from schedules where a matching record exists in products with the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14638
train
v1
Schema: branches (alias: brc)(status, level, id, code) transactions(status, type, level, name) Task: Retrieve name from branches whose level is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = brc.code );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14639
train
v3
Schema: regions (alias: rgn)(date, status, name, level) branches(date, value, name, amount) Task: Find name from regions where salary exceeds the minimum salary from branches for the same level. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14640
train
v2
Schema: invoices (alias: inv)(id, amount, name, date) employees(amount, level, id, date) Task: Find name from invoices where a matching record exists in employees with the same type. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14641
train
v3
Schema: invoices (alias: inv)(id, type, status, date) transactions(value, status, id, level) Task: Retrieve id from invoices with salary above the AVG(salary) of transactions rows sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14642
train
v3
Schema: departments (alias: dept)(type, status, level, id) requests(level, amount, name, code) Task: Retrieve name from departments with value above the MIN(amount) of requests rows sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14643
train
v1
Schema: regions (alias: rgn)(status, date, value, level) orders(code, date, id, status) Task: Find name from regions where id appears in orders entries with matching level. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14644
train
v1
Schema: customers (alias: cust)(level, code, date, salary) requests(id, code, value, level) Task: Find value from customers where status appears in requests entries with matching type. SQL:
SELECT value FROM customers AS cust WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14645
train
v1
Schema: branches (alias: brc)(name, salary, date, level) requests(level, value, status, code) Task: Select salary from branches where status exists in requests for the same status. SQL:
SELECT salary FROM branches AS brc WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = brc.status );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14646
train
v1
Schema: regions (alias: rgn)(level, id, value, code) managers(type, salary, level, code) Task: Find code from regions where type appears in managers entries with matching id. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14647
train
v1
Schema: accounts (alias: acct)(status, name, salary, amount) projects(level, salary, status, id) Task: Select amount from accounts where type exists in projects for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = acct.id );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14648
train
v2
Schema: categories (alias: catg)(id, name, level, amount) transactions(date, amount, name, status) Task: Retrieve code from categories that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14649
train
v2
Schema: tasks (alias: tsk)(amount, name, id, status) transactions(type, amount, salary, id) Task: Retrieve code from tasks that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14650
train
v1
Schema: categories (alias: catg)(level, id, value, status) customers(status, value, amount, id) Task: Select id from categories where code exists in customers for the same type. SQL:
SELECT id FROM categories AS catg WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14651
train
v2
Schema: sales (alias: sale)(date, value, status, level) shipments(name, id, date, salary) Task: Find code from sales where a matching record exists in shipments with the same type. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14652
train
v2
Schema: products (alias: prod)(salary, type, level, value) transactions(status, level, date, code) Task: Retrieve amount from products that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14653
train
v3
Schema: departments (alias: dept)(date, name, id, value) customers(id, code, date, status) Task: Find name from departments where value exceeds the count of value from customers for the same code. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.code = dept.code );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14654
train
v3
Schema: schedules (alias: schd)(salary, status, date, code) items(code, type, salary, status) Task: Find amount from schedules where amount exceeds the count of amount from items for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14655
train
v3
Schema: managers (alias: mgr)(name, id, status, code) shipments(date, type, id, level) Task: Find name from managers where salary exceeds the average value from shipments for the same type. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14656
train
v3
Schema: items (alias: lne)(name, id, level, amount) requests(value, name, type, salary) Task: Find name from items where amount exceeds the minimum value from requests for the same id. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14657
train
v3
Schema: employees (alias: emp)(status, amount, name, level) regions(type, value, code, status) Task: Find code from employees where amount exceeds the maximum value from regions for the same code. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14658
train
v1
Schema: projects (alias: prj)(date, status, salary, name) transactions(level, salary, value, code) Task: Select value from projects where id exists in transactions for the same type. SQL:
SELECT value FROM projects AS prj WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = prj.type );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_14659
train
v1
Schema: customers (alias: cust)(name, salary, date, id) staff(type, salary, id, date) Task: Retrieve name from customers whose status is found in staff rows where level matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = cust.level );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14660
train
v3
Schema: products (alias: prod)(value, type, salary, id) departments(level, value, amount, code) Task: Find code from products where salary exceeds the minimum amount from departments for the same type. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.type = prod.type );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14661
train
v3
Schema: departments (alias: dept)(status, id, amount, type) requests(salary, level, name, amount) Task: Find value from departments where salary exceeds the count of salary from requests for the same level. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.level = dept.level );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "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_14662
train
v2
Schema: branches (alias: brc)(code, amount, date, salary) orders(value, type, code, amount) Task: Retrieve salary from branches that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = brc.level );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14663
train
v1
Schema: categories (alias: catg)(type, date, level, name) items(name, value, code, type) Task: Retrieve name from categories whose id is found in items rows where type matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14664
train
v2
Schema: managers (alias: mgr)(date, type, status, id) requests(status, date, level, code) Task: Retrieve value from managers that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14665
train
v2
Schema: sales (alias: sale)(type, date, amount, salary) requests(id, date, status, value) Task: Find id from sales where a matching record exists in requests with the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14666
train
v3
Schema: accounts (alias: acct)(name, code, id, status) projects(value, salary, code, name) Task: Retrieve name from accounts with salary above the SUM(salary) of projects rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14667
train
v1
Schema: categories (alias: catg)(type, status, amount, code) branches(value, id, code, status) Task: Find id from categories where level appears in branches entries with matching id. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.id = catg.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14668
train
v1
Schema: products (alias: prod)(type, code, status, amount) accounts(name, code, value, id) Task: Select code from products where id exists in accounts for the same type. SQL:
SELECT code FROM products AS prod WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14669
train
v3
Schema: tasks (alias: tsk)(id, date, type, value) staff(type, date, salary, status) Task: Find name from tasks where value exceeds the average salary from staff for the same level. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14670
train
v2
Schema: tasks (alias: tsk)(amount, level, salary, code) shipments(name, date, value, status) Task: Find amount from tasks where a matching record exists in shipments with the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "amount", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_14671
train
v1
Schema: schedules (alias: schd)(name, level, date, value) accounts(salary, type, name, status) Task: Select value from schedules where type exists in accounts for the same status. SQL:
SELECT value FROM schedules AS schd WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14672
train
v2
Schema: items (alias: lne)(code, type, date, amount) tasks(amount, code, date, level) Task: Find code from items where a matching record exists in tasks with the same code. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14673
train
v1
Schema: schedules (alias: schd)(date, code, level, amount) sales(code, type, salary, name) Task: Retrieve amount from schedules whose type is found in sales rows where type matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14674
train
v3
Schema: categories (alias: catg)(salary, type, name, status) accounts(id, code, name, type) Task: Find id from categories where value exceeds the minimum amount from accounts for the same status. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT MIN(amount) 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": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14675
train
v1
Schema: employees (alias: emp)(code, name, id, amount) orders(level, name, status, type) Task: Select name from employees where status exists in orders for the same level. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14676
train
v1
Schema: schedules (alias: schd)(value, code, name, id) requests(id, salary, type, code) Task: Select name from schedules where level exists in requests for the same status. SQL:
SELECT name 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": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14677
train
v3
Schema: schedules (alias: schd)(salary, amount, code, value) invoices(status, level, amount, salary) Task: Find name from schedules where salary exceeds the average salary from invoices for the same level. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14678
train
v2
Schema: employees (alias: emp)(date, value, amount, level) branches(date, level, salary, code) Task: Find code from employees where a matching record exists in branches with the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14679
train
v1
Schema: departments (alias: dept)(code, type, amount, name) orders(name, amount, date, level) Task: Retrieve amount from departments whose id is found in orders rows where code matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14680
train
v1
Schema: requests (alias: ordr)(value, id, date, status) transactions(code, level, status, amount) Task: Find value from requests where type appears in transactions entries with matching code. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14681
train
v3
Schema: invoices (alias: inv)(amount, type, date, salary) transactions(id, level, value, date) Task: Find code from invoices where value exceeds the total amount from transactions for the same type. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14682
train
v1
Schema: employees (alias: emp)(level, value, status, date) projects(code, amount, date, value) Task: Find code from employees where level appears in projects entries with matching code. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.code = emp.code );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14683
train
v1
Schema: branches (alias: brc)(level, id, name, salary) staff(salary, name, code, status) Task: Retrieve id from branches whose code is found in staff rows where code matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = brc.code );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_14684
train
v3
Schema: regions (alias: rgn)(code, level, status, name) managers(date, value, type, status) Task: Retrieve code from regions with value above the COUNT(amount) of managers rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_14685
train
v3
Schema: staff (alias: empl)(level, date, id, code) tasks(code, status, date, amount) Task: Find value from staff where amount exceeds the maximum value from tasks for the same level. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.level = empl.level );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14686
train
v1
Schema: transactions (alias: txn)(status, amount, name, value) customers(id, type, date, level) Task: Retrieve amount from transactions whose type is found in customers rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14687
train
v2
Schema: products (alias: prod)(date, code, name, id) customers(date, type, code, value) Task: Find salary from products where a matching record exists in customers with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = prod.level );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14688
train
v2
Schema: departments (alias: dept)(date, code, level, status) sales(name, value, status, type) Task: Retrieve salary from departments that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14689
train
v2
Schema: accounts (alias: acct)(salary, level, name, id) branches(salary, id, status, name) Task: Retrieve salary from accounts that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "salary", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14690
train
v1
Schema: requests (alias: ordr)(salary, status, date, code) categories(name, salary, amount, type) Task: Retrieve name from requests whose level is found in categories rows where level matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_14691
train
v3
Schema: staff (alias: empl)(id, value, level, amount) branches(salary, type, level, value) Task: Find salary from staff where salary exceeds the maximum salary from branches for the same type. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.type = empl.type );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_14692
train
v2
Schema: departments (alias: dept)(code, date, value, status) projects(status, level, id, name) Task: Retrieve amount from departments that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = dept.status );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14693
train
v3
Schema: sales (alias: sale)(value, code, type, level) schedules(salary, name, status, date) Task: Find value from sales where value exceeds the average salary from schedules for the same status. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14694
train
v3
Schema: items (alias: lne)(id, name, value, code) shipments(date, status, type, level) Task: Retrieve amount from items with salary above the COUNT(amount) of shipments rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.id = lne.id );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_14695
train
v2
Schema: departments (alias: dept)(value, date, status, salary) customers(level, status, name, value) Task: Find id from departments where a matching record exists in customers with the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = dept.type );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14696
train
v3
Schema: departments (alias: dept)(status, code, id, level) transactions(amount, code, name, value) Task: Find name from departments where value exceeds the count of amount from transactions for the same level. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14697
train
v3
Schema: schedules (alias: schd)(name, salary, type, level) shipments(type, level, name, status) Task: Find salary from schedules where value exceeds the average value from shipments for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_14698
train
v1
Schema: orders (alias: ord)(level, type, salary, date) invoices(level, salary, amount, type) Task: Select amount from orders where status exists in invoices for the same level. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_14699
train