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: schedules (alias: schd)(status, level, salary, code) branches(value, name, status, level) Task: Retrieve id from schedules whose status is found in branches rows where type matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18500
train
v3
Schema: schedules (alias: schd)(level, id, salary, amount) transactions(code, id, type, date) Task: Find code from schedules where salary exceeds the total value from transactions for the same id. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18501
train
v1
Schema: requests (alias: ordr)(salary, date, status, value) accounts(type, id, date, code) Task: Find name from requests where code appears in accounts entries with matching level. SQL:
SELECT name FROM requests AS ordr WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18502
train
v2
Schema: regions (alias: rgn)(name, status, type, id) employees(id, amount, code, name) Task: Retrieve name from regions that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18503
train
v2
Schema: tasks (alias: tsk)(salary, type, level, id) shipments(date, amount, status, code) Task: Retrieve code from tasks that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18504
train
v1
Schema: accounts (alias: acct)(status, value, level, amount) staff(salary, amount, code, type) Task: Find id from accounts where code appears in staff entries with matching level. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18505
train
v3
Schema: items (alias: lne)(type, date, salary, amount) staff(level, amount, code, id) Task: Find name from items where salary exceeds the average value from staff for the same status. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT AVG(value) FROM staff AS empl WHERE empl.status = lne.status );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18506
train
v2
Schema: departments (alias: dept)(code, level, id, amount) sales(status, name, value, code) Task: Find id from departments where a matching record exists in sales with the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18507
train
v1
Schema: tasks (alias: tsk)(value, code, salary, id) branches(level, salary, code, type) Task: Retrieve salary from tasks whose id is found in branches rows where id matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18508
train
v1
Schema: managers (alias: mgr)(salary, name, value, status) staff(level, type, salary, code) Task: Retrieve amount from managers whose id is found in staff rows where level matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18509
train
v2
Schema: employees (alias: emp)(code, level, id, name) schedules(code, type, amount, value) Task: Find value from employees where a matching record exists in schedules with the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18510
train
v1
Schema: staff (alias: empl)(level, amount, status, name) sales(status, value, id, type) Task: Retrieve name from staff whose level is found in sales rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18511
train
v3
Schema: requests (alias: ordr)(level, type, value, salary) customers(name, date, salary, id) Task: Find name from requests where salary exceeds the maximum amount from customers for the same status. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18512
train
v1
Schema: requests (alias: ordr)(code, level, id, type) staff(status, salary, amount, date) Task: Find name from requests where id appears in staff entries with matching code. SQL:
SELECT name FROM requests AS ordr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18513
train
v1
Schema: accounts (alias: acct)(date, status, id, salary) invoices(value, salary, level, type) Task: Find code from accounts where type appears in invoices entries with matching status. SQL:
SELECT code FROM accounts AS acct WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = acct.status );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18514
train
v3
Schema: schedules (alias: schd)(id, name, salary, level) orders(level, name, amount, id) Task: Retrieve code from schedules with salary above the MIN(value) of orders rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18515
train
v3
Schema: requests (alias: ordr)(id, salary, name, level) regions(salary, type, code, value) Task: Retrieve salary from requests with amount above the AVG(amount) of regions rows sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18516
train
v3
Schema: shipments (alias: shp)(id, status, type, salary) items(salary, id, amount, value) Task: Find salary from shipments where amount exceeds the count of salary from items for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18517
train
v1
Schema: accounts (alias: acct)(level, date, status, type) tasks(value, date, name, level) Task: Select name from accounts where id exists in tasks for the same id. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18518
train
v3
Schema: transactions (alias: txn)(code, level, value, name) tasks(id, level, date, value) Task: Retrieve code from transactions with salary above the AVG(value) of tasks rows sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.status = txn.status );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18519
train
v2
Schema: customers (alias: cust)(level, id, date, code) projects(status, value, amount, date) Task: Find value from customers where a matching record exists in projects with the same id. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = cust.id );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "value", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18520
train
v2
Schema: categories (alias: catg)(date, code, status, value) staff(amount, type, date, value) Task: Retrieve code from categories that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18521
train
v2
Schema: employees (alias: emp)(status, name, date, salary) staff(salary, type, code, level) Task: Retrieve amount from employees that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = emp.id );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18522
train
v3
Schema: schedules (alias: schd)(salary, amount, name, date) orders(type, id, amount, name) Task: Find value from schedules where value exceeds the count of value from orders for the same type. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18523
train
v2
Schema: sales (alias: sale)(id, salary, type, level) employees(amount, salary, type, value) Task: Retrieve amount from sales that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = sale.level );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18524
train
v2
Schema: sales (alias: sale)(salary, date, value, status) regions(salary, id, amount, name) Task: Retrieve code from sales that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18525
train
v2
Schema: branches (alias: brc)(value, id, amount, type) transactions(status, code, salary, value) Task: Retrieve salary from branches that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = brc.level );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "salary", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18526
train
v3
Schema: accounts (alias: acct)(status, name, code, level) sales(id, date, code, level) Task: Retrieve value from accounts with value above the MAX(value) of sales rows sharing the same level. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.level = acct.level );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18527
train
v1
Schema: regions (alias: rgn)(status, date, salary, id) customers(salary, amount, type, id) Task: Select salary from regions where type exists in customers for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18528
train
v1
Schema: departments (alias: dept)(value, name, date, status) shipments(salary, code, amount, type) Task: Select value from departments where type exists in shipments for the same status. SQL:
SELECT value FROM departments AS dept WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18529
train
v2
Schema: requests (alias: ordr)(date, salary, level, code) employees(code, amount, date, type) Task: Find id from requests where a matching record exists in employees with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18530
train
v1
Schema: customers (alias: cust)(value, type, date, id) regions(name, value, status, id) Task: Retrieve code from customers whose level is found in regions rows where level matches the outer record. SQL:
SELECT code FROM customers AS cust WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18531
train
v1
Schema: branches (alias: brc)(id, name, amount, type) sales(salary, name, id, code) Task: Select value from branches where code exists in sales for the same level. SQL:
SELECT value FROM branches AS brc WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = brc.level );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18532
train
v3
Schema: requests (alias: ordr)(name, date, id, amount) shipments(date, code, salary, level) Task: Retrieve id from requests with value above the MAX(value) of shipments rows sharing the same level. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18533
train
v3
Schema: employees (alias: emp)(level, salary, date, status) regions(salary, name, status, amount) Task: Retrieve name from employees with salary above the COUNT(value) of regions rows sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.id = emp.id );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18534
train
v2
Schema: branches (alias: brc)(amount, type, value, level) invoices(code, type, value, level) Task: Retrieve value from branches that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = brc.code );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18535
train
v3
Schema: shipments (alias: shp)(value, date, code, salary) requests(salary, name, date, code) Task: Find id from shipments where value exceeds the average amount from requests for the same type. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18536
train
v3
Schema: staff (alias: empl)(status, level, type, amount) sales(status, level, salary, value) Task: Find id from staff where salary exceeds the total salary from sales for the same code. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18537
train
v1
Schema: accounts (alias: acct)(type, value, status, salary) orders(id, type, amount, level) Task: Retrieve value from accounts whose status is found in orders rows where status matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = acct.status );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18538
train
v2
Schema: staff (alias: empl)(id, type, date, level) tasks(value, type, date, code) Task: Find code from staff where a matching record exists in tasks with the same type. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = empl.type );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18539
train
v2
Schema: sales (alias: sale)(type, id, amount, date) regions(type, date, value, salary) Task: Retrieve id from sales that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = sale.code );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18540
train
v3
Schema: transactions (alias: txn)(value, level, date, type) regions(value, name, status, date) Task: Find amount from transactions where amount exceeds the average value from regions for the same level. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18541
train
v2
Schema: accounts (alias: acct)(status, level, id, value) employees(level, salary, date, status) Task: Find code from accounts where a matching record exists in employees with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18542
train
v1
Schema: branches (alias: brc)(code, value, status, type) projects(value, amount, date, status) Task: Find amount from branches where code appears in projects entries with matching id. SQL:
SELECT amount FROM branches AS brc WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = brc.id );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18543
train
v1
Schema: sales (alias: sale)(status, name, value, salary) staff(code, value, id, name) Task: Select id from sales where type exists in staff for the same level. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = sale.level );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18544
train
v3
Schema: projects (alias: prj)(id, date, value, type) invoices(name, salary, value, date) Task: Find id from projects where value exceeds the maximum amount from invoices for the same id. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.id = prj.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18545
train
v3
Schema: staff (alias: empl)(level, name, code, status) products(id, amount, code, type) Task: Find code from staff where salary exceeds the average value from products for the same status. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT AVG(value) FROM products AS prod WHERE prod.status = empl.status );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18546
train
v2
Schema: requests (alias: ordr)(value, id, name, code) categories(date, name, type, salary) Task: Find id from requests where a matching record exists in categories with the same type. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18547
train
v2
Schema: schedules (alias: schd)(level, type, amount, status) accounts(value, code, amount, salary) Task: Find id from schedules where a matching record exists in accounts with the same code. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = schd.code );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18548
train
v1
Schema: sales (alias: sale)(value, date, level, type) regions(name, date, level, status) Task: Select value from sales where id exists in regions for the same status. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18549
train
v3
Schema: categories (alias: catg)(amount, salary, value, name) orders(code, date, salary, level) Task: Find value from categories where value exceeds the minimum amount from orders for the same type. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.type = catg.type );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18550
train
v1
Schema: customers (alias: cust)(name, level, salary, date) categories(status, salary, code, name) Task: Select code from customers where status exists in categories for the same level. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18551
train
v3
Schema: projects (alias: prj)(type, date, value, status) shipments(amount, date, code, name) Task: Retrieve salary from projects with salary above the COUNT(amount) of shipments rows sharing the same id. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.id = prj.id );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18552
train
v1
Schema: products (alias: prod)(salary, value, amount, name) requests(code, date, value, salary) Task: Find value from products where type appears in requests entries with matching code. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18553
train
v3
Schema: staff (alias: empl)(id, salary, value, status) branches(name, id, date, type) Task: Retrieve code from staff with salary above the SUM(value) of branches rows sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT SUM(value) FROM branches AS brc WHERE brc.level = empl.level );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18554
train
v2
Schema: regions (alias: rgn)(salary, amount, code, value) customers(amount, salary, date, id) Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18555
train
v3
Schema: projects (alias: prj)(name, amount, value, code) managers(amount, level, date, salary) Task: Retrieve id from projects with value above the MAX(amount) of managers rows sharing the same code. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.code = prj.code );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18556
train
v2
Schema: managers (alias: mgr)(salary, date, value, type) employees(salary, name, level, status) Task: Find salary from managers where a matching record exists in employees with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18557
train
v3
Schema: requests (alias: ordr)(code, amount, level, date) branches(salary, name, status, level) Task: Retrieve salary from requests with value above the SUM(amount) of branches rows sharing the same type. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18558
train
v2
Schema: projects (alias: prj)(code, name, salary, level) requests(level, status, salary, type) Task: Find value from projects where a matching record exists in requests with the same type. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = prj.type );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18559
train
v2
Schema: employees (alias: emp)(type, code, amount, salary) shipments(salary, amount, name, type) Task: Find name from employees where a matching record exists in shipments with the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18560
train
v2
Schema: branches (alias: brc)(name, date, code, amount) managers(id, code, salary, name) Task: Find id from branches where a matching record exists in managers with the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = brc.status );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18561
train
v1
Schema: categories (alias: catg)(code, value, amount, type) tasks(salary, level, type, status) Task: Select value from categories where level exists in tasks for the same status. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = catg.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18562
train
v2
Schema: transactions (alias: txn)(name, id, value, level) categories(type, name, value, id) Task: Retrieve id from transactions that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18563
train
v2
Schema: regions (alias: rgn)(code, salary, id, name) transactions(value, name, amount, date) Task: Find value from regions where a matching record exists in transactions with the same type. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = rgn.type );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18564
train
v2
Schema: projects (alias: prj)(value, id, salary, date) regions(date, id, amount, salary) Task: Retrieve id from projects that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18565
train
v1
Schema: schedules (alias: schd)(value, date, salary, id) categories(date, amount, value, code) Task: Retrieve value from schedules whose id is found in categories rows where id matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18566
train
v3
Schema: branches (alias: brc)(value, amount, id, date) items(salary, amount, level, status) Task: Retrieve amount from branches with value above the COUNT(salary) of items rows sharing the same type. SQL:
SELECT amount FROM branches AS brc WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.type = brc.type );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18567
train
v2
Schema: invoices (alias: inv)(level, type, amount, date) employees(amount, date, status, level) Task: Find name from invoices where a matching record exists in employees with the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18568
train
v1
Schema: shipments (alias: shp)(value, level, status, type) managers(code, name, salary, value) Task: Retrieve value from shipments whose code is found in managers rows where type matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18569
train
v1
Schema: orders (alias: ord)(level, amount, status, code) items(id, salary, value, type) Task: Select amount from orders where status exists in items for the same status. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18570
train
v1
Schema: tasks (alias: tsk)(date, status, name, value) items(id, code, amount, name) Task: Find code from tasks where code appears in items entries with matching id. SQL:
SELECT code FROM tasks AS tsk WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18571
train
v2
Schema: managers (alias: mgr)(level, code, status, date) departments(amount, id, value, level) Task: Retrieve name from managers that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18572
train
v1
Schema: accounts (alias: acct)(id, date, salary, type) shipments(status, value, salary, level) Task: Retrieve amount from accounts whose level is found in shipments rows where level matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18573
train
v2
Schema: transactions (alias: txn)(code, value, id, status) schedules(date, code, id, value) Task: Retrieve code from transactions that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18574
train
v3
Schema: customers (alias: cust)(date, salary, value, type) orders(level, name, status, date) Task: Retrieve amount from customers with salary above the COUNT(salary) of orders rows sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18575
train
v2
Schema: items (alias: lne)(date, status, type, value) orders(name, level, id, salary) Task: Retrieve name from items that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18576
train
v3
Schema: regions (alias: rgn)(id, date, status, amount) categories(level, value, salary, name) Task: Retrieve id from regions with value above the MIN(salary) of categories rows sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.status = rgn.status );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18577
train
v2
Schema: tasks (alias: tsk)(code, value, level, name) schedules(type, id, status, value) Task: Retrieve amount from tasks that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18578
train
v3
Schema: employees (alias: emp)(status, amount, code, date) categories(code, salary, date, status) Task: Find name from employees where value exceeds the minimum salary from categories for the same code. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18579
train
v2
Schema: shipments (alias: shp)(status, code, date, level) employees(id, level, value, salary) Task: Find code from shipments where a matching record exists in employees with the same code. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = shp.code );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18580
train
v2
Schema: tasks (alias: tsk)(value, level, status, date) sales(amount, id, code, date) Task: Find id from tasks where a matching record exists in sales with the same status. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18581
train
v2
Schema: products (alias: prod)(amount, status, date, level) categories(level, value, date, status) Task: Find id from products where a matching record exists in categories with the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18582
train
v3
Schema: shipments (alias: shp)(status, level, type, id) departments(salary, id, type, date) Task: Retrieve value from shipments with amount above the AVG(salary) of departments rows sharing the same level. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.level = shp.level );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18583
train
v3
Schema: products (alias: prod)(level, name, date, type) staff(value, id, salary, amount) Task: Find salary from products where value exceeds the count of value from staff for the same type. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18584
train
v2
Schema: regions (alias: rgn)(date, code, status, amount) managers(value, id, type, code) Task: Find code from regions where a matching record exists in managers with the same level. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18585
train
v3
Schema: accounts (alias: acct)(date, name, amount, level) categories(type, amount, id, value) Task: Retrieve amount from accounts with value above the COUNT(value) of categories rows sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18586
train
v3
Schema: staff (alias: empl)(id, type, date, level) schedules(status, type, level, value) Task: Retrieve salary from staff with value above the MAX(amount) of schedules rows sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18587
train
v2
Schema: departments (alias: dept)(type, level, name, salary) transactions(status, amount, name, code) Task: Retrieve name from departments that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = dept.status );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18588
train
v1
Schema: shipments (alias: shp)(date, value, salary, status) projects(id, name, level, type) Task: Retrieve amount from shipments whose status is found in projects rows where id matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = shp.id );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18589
train
v3
Schema: managers (alias: mgr)(type, status, date, code) departments(level, amount, status, type) Task: Find salary from managers where salary exceeds the minimum salary from departments for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18590
train
v1
Schema: requests (alias: ordr)(value, id, level, name) branches(status, id, type, date) Task: Select id from requests where status exists in branches for the same level. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = ordr.level );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18591
train
v1
Schema: orders (alias: ord)(date, code, level, amount) products(name, id, salary, date) Task: Retrieve code from orders whose code is found in products rows where type matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18592
train
v1
Schema: accounts (alias: acct)(name, type, level, code) products(id, salary, status, name) Task: Select name from accounts where status exists in products for the same id. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = acct.id );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18593
train
v1
Schema: products (alias: prod)(level, amount, value, name) branches(salary, amount, id, date) Task: Retrieve value from products whose id is found in branches rows where status matches the outer record. SQL:
SELECT value FROM products AS prod WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18594
train
v3
Schema: employees (alias: emp)(name, type, amount, date) transactions(id, date, code, salary) Task: Find value from employees where amount exceeds the minimum salary from transactions for the same level. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18595
train
v3
Schema: customers (alias: cust)(code, amount, salary, date) sales(amount, level, status, date) Task: Retrieve value from customers with value above the AVG(salary) of sales rows sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18596
train
v2
Schema: accounts (alias: acct)(name, salary, code, level) orders(amount, name, code, status) Task: Find id from accounts where a matching record exists in orders with the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = acct.status );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18597
train
v1
Schema: invoices (alias: inv)(salary, status, code, level) items(salary, date, amount, type) Task: Select name from invoices where status exists in items for the same id. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18598
train
v2
Schema: invoices (alias: inv)(type, id, salary, value) accounts(id, level, code, value) Task: Retrieve name from invoices that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18599
train