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
v3
Schema: transactions (alias: txn)(name, amount, type, id) accounts(id, status, code, date) Task: Retrieve amount from transactions with amount above the COUNT(salary) of accounts rows sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16800
train
v3
Schema: schedules (alias: schd)(type, id, status, code) accounts(type, level, amount, date) Task: Find name from schedules where salary exceeds the maximum amount from accounts for the same level. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.level = schd.level );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16801
train
v2
Schema: accounts (alias: acct)(id, date, salary, name) transactions(type, level, status, id) Task: Retrieve name from accounts that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16802
train
v1
Schema: tasks (alias: tsk)(type, code, salary, level) categories(name, code, amount, id) Task: Find salary from tasks where type appears in categories entries with matching id. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16803
train
v3
Schema: transactions (alias: txn)(date, id, type, salary) projects(date, id, code, type) Task: Retrieve salary from transactions with salary above the SUM(amount) of projects rows sharing the same level. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.level = txn.level );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16804
train
v3
Schema: regions (alias: rgn)(salary, id, date, status) shipments(code, name, amount, value) Task: Find code from regions where amount exceeds the total salary from shipments for the same id. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16805
train
v2
Schema: customers (alias: cust)(date, amount, name, value) items(value, code, type, salary) Task: Find amount from customers where a matching record exists in items with the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16806
train
v3
Schema: projects (alias: prj)(date, level, value, type) employees(level, date, status, value) Task: Find id from projects where salary exceeds the minimum salary from employees for the same id. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.id = prj.id );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16807
train
v3
Schema: regions (alias: rgn)(value, name, type, amount) orders(type, status, name, id) Task: Find value from regions where value exceeds the maximum salary from orders for the same level. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16808
train
v1
Schema: regions (alias: rgn)(level, value, salary, status) schedules(id, status, type, salary) Task: Retrieve id from regions whose status is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16809
train
v3
Schema: departments (alias: dept)(level, status, id, type) items(salary, value, type, date) Task: Find amount from departments where salary exceeds the minimum value from items for the same status. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16810
train
v3
Schema: requests (alias: ordr)(salary, type, level, date) customers(date, code, name, id) Task: Retrieve amount from requests with amount above the MAX(salary) of customers rows sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16811
train
v2
Schema: staff (alias: empl)(level, salary, code, value) items(id, level, salary, date) Task: Find code from staff where a matching record exists in items with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16812
train
v1
Schema: sales (alias: sale)(id, date, salary, amount) requests(code, value, id, name) Task: Find amount from sales where id appears in requests entries with matching level. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16813
train
v1
Schema: invoices (alias: inv)(value, code, salary, type) items(status, type, amount, name) Task: Select id from invoices where level exists in items for the same code. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16814
train
v1
Schema: branches (alias: brc)(code, level, status, amount) staff(code, name, type, value) Task: Find amount from branches where code appears in staff entries with matching type. SQL:
SELECT amount FROM branches AS brc WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = brc.type );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16815
train
v2
Schema: items (alias: lne)(salary, amount, level, name) transactions(code, type, id, date) Task: Find name from items where a matching record exists in transactions with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16816
train
v2
Schema: branches (alias: brc)(code, type, name, date) shipments(code, id, status, type) Task: Retrieve name from branches that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = brc.id );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16817
train
v2
Schema: shipments (alias: shp)(code, id, salary, amount) staff(level, id, type, code) Task: Find id from shipments where a matching record exists in staff with the same status. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_16818
train
v3
Schema: departments (alias: dept)(value, code, type, name) invoices(salary, amount, status, id) Task: Find id from departments where amount exceeds the average amount from invoices for the same status. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16819
train
v3
Schema: projects (alias: prj)(type, salary, value, status) regions(amount, salary, code, type) Task: Find id from projects where value exceeds the total salary from regions for the same level. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16820
train
v2
Schema: managers (alias: mgr)(value, amount, salary, level) tasks(salary, status, amount, value) Task: Find amount from managers where a matching record exists in tasks with the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = mgr.status );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16821
train
v3
Schema: invoices (alias: inv)(amount, name, date, status) tasks(salary, type, name, date) Task: Retrieve id from invoices with salary above the MIN(salary) of tasks rows sharing the same id. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16822
train
v3
Schema: branches (alias: brc)(level, date, id, type) items(name, type, date, salary) Task: Find id from branches where value exceeds the count of salary from items for the same level. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = brc.level );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16823
train
v1
Schema: categories (alias: catg)(id, value, status, salary) transactions(code, type, value, salary) Task: Retrieve id from categories whose level is found in transactions rows where level matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16824
train
v3
Schema: transactions (alias: txn)(salary, type, date, name) sales(name, type, code, id) Task: Retrieve salary from transactions with amount above the MIN(salary) of sales rows sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16825
train
v3
Schema: orders (alias: ord)(amount, value, salary, id) schedules(id, level, amount, date) Task: Retrieve amount from orders with amount above the MAX(amount) of schedules rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16826
train
v1
Schema: items (alias: lne)(status, code, amount, level) departments(name, amount, level, type) Task: Find code from items where id appears in departments entries with matching level. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16827
train
v1
Schema: branches (alias: brc)(salary, date, name, amount) shipments(amount, code, date, id) Task: Find value from branches where level appears in shipments entries with matching code. SQL:
SELECT value FROM branches AS brc WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = brc.code );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16828
train
v1
Schema: items (alias: lne)(status, level, id, code) staff(type, level, date, amount) Task: Retrieve name from items whose code is found in staff rows where type matches the outer record. SQL:
SELECT name FROM items AS lne WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16829
train
v1
Schema: accounts (alias: acct)(date, level, type, code) customers(code, id, amount, name) Task: Select salary from accounts where id exists in customers for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = acct.level );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16830
train
v2
Schema: products (alias: prod)(value, status, date, amount) employees(salary, name, value, amount) Task: Retrieve amount from products that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16831
train
v1
Schema: tasks (alias: tsk)(value, amount, salary, date) accounts(date, type, level, code) Task: Find code from tasks where code appears in accounts entries with matching level. SQL:
SELECT code FROM tasks AS tsk WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16832
train
v2
Schema: transactions (alias: txn)(amount, salary, name, id) employees(date, name, id, salary) Task: Find amount from transactions where a matching record exists in employees with the same code. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16833
train
v2
Schema: items (alias: lne)(amount, value, code, name) branches(value, id, type, level) Task: Find value from items where a matching record exists in branches with the same level. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = lne.level );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "value", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16834
train
v3
Schema: orders (alias: ord)(value, status, name, id) projects(date, code, status, amount) Task: Retrieve id from orders with amount above the MIN(salary) of projects rows sharing the same id. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.id = ord.id );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16835
train
v3
Schema: schedules (alias: schd)(amount, value, level, type) shipments(salary, date, name, type) Task: Retrieve code from schedules with value above the COUNT(amount) of shipments rows sharing the same code. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16836
train
v2
Schema: employees (alias: emp)(value, level, type, id) shipments(level, id, date, type) Task: Retrieve amount from employees that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16837
train
v3
Schema: tasks (alias: tsk)(amount, code, level, date) accounts(date, id, amount, name) Task: Retrieve amount from tasks with salary above the SUM(amount) of accounts rows sharing the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16838
train
v2
Schema: shipments (alias: shp)(type, amount, level, status) customers(code, level, date, name) Task: Find name from shipments where a matching record exists in customers with the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_16839
train
v1
Schema: invoices (alias: inv)(value, id, type, level) projects(type, name, salary, amount) Task: Retrieve id from invoices whose level is found in projects rows where code matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.code = inv.code );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16840
train
v2
Schema: sales (alias: sale)(level, code, type, id) employees(value, date, status, id) Task: Find name from sales where a matching record exists in employees with the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16841
train
v2
Schema: transactions (alias: txn)(amount, name, salary, level) requests(level, amount, code, id) Task: Retrieve amount from transactions that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16842
train
v2
Schema: invoices (alias: inv)(date, status, value, level) employees(code, salary, date, level) Task: Retrieve code from invoices that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16843
train
v1
Schema: sales (alias: sale)(date, id, amount, salary) shipments(amount, level, id, type) Task: Retrieve name from sales whose level is found in shipments rows where status matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16844
train
v1
Schema: requests (alias: ordr)(salary, id, name, amount) staff(amount, status, level, code) Task: Select amount from requests where type exists in staff for the same level. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = ordr.level );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16845
train
v1
Schema: departments (alias: dept)(salary, name, id, amount) orders(code, name, date, value) Task: Find code from departments where type appears in orders entries with matching code. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16846
train
v3
Schema: departments (alias: dept)(amount, status, date, salary) categories(date, value, id, name) Task: Find salary from departments where amount exceeds the maximum value from categories for the same level. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MAX(value) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16847
train
v2
Schema: invoices (alias: inv)(type, name, level, date) managers(date, salary, amount, code) Task: Find id from invoices where a matching record exists in managers with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16848
train
v1
Schema: managers (alias: mgr)(status, salary, type, date) orders(id, level, value, code) Task: Find value from managers where type appears in orders entries with matching status. SQL:
SELECT value FROM managers AS mgr WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16849
train
v1
Schema: branches (alias: brc)(date, status, code, level) categories(salary, id, level, type) Task: Select code from branches where id exists in categories for the same level. SQL:
SELECT code FROM branches AS brc WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = brc.level );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16850
train
v3
Schema: projects (alias: prj)(id, date, salary, level) regions(name, status, type, date) Task: Retrieve amount from projects with amount above the COUNT(salary) of regions rows sharing the same level. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16851
train
v1
Schema: categories (alias: catg)(amount, date, status, id) transactions(name, level, status, amount) Task: Retrieve name from categories whose code is found in transactions rows where status matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16852
train
v3
Schema: transactions (alias: txn)(date, type, name, level) accounts(status, value, code, name) Task: Retrieve name from transactions with salary above the SUM(value) of accounts rows sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16853
train
v3
Schema: products (alias: prod)(level, code, value, type) sales(code, status, amount, salary) Task: Retrieve name from products with amount above the AVG(amount) of sales rows sharing the same id. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16854
train
v1
Schema: employees (alias: emp)(type, id, name, amount) orders(id, salary, code, value) Task: Select value from employees where code exists in orders for the same code. SQL:
SELECT value FROM employees AS emp WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16855
train
v3
Schema: schedules (alias: schd)(value, name, code, id) accounts(value, amount, status, date) Task: Retrieve salary from schedules with value above the MAX(amount) of accounts rows sharing the same code. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.code = schd.code );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16856
train
v1
Schema: requests (alias: ordr)(status, name, amount, id) regions(date, name, amount, status) Task: Retrieve code from requests whose code is found in regions rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16857
train
v3
Schema: categories (alias: catg)(level, salary, date, type) items(name, id, amount, status) Task: Retrieve salary from categories with salary above the MAX(salary) of items rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16858
train
v3
Schema: regions (alias: rgn)(status, date, value, amount) requests(salary, status, code, id) Task: Retrieve salary from regions with value above the COUNT(amount) of requests rows sharing the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16859
train
v3
Schema: items (alias: lne)(amount, status, code, id) departments(name, type, level, code) Task: Find amount from items where salary exceeds the count of salary from departments for the same type. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.type = lne.type );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16860
train
v1
Schema: managers (alias: mgr)(name, date, salary, value) regions(name, code, amount, salary) Task: Find value from managers where code appears in regions entries with matching id. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16861
train
v1
Schema: invoices (alias: inv)(date, level, code, value) items(status, id, type, amount) Task: Select id from invoices where code exists in items for the same id. SQL:
SELECT id FROM invoices AS inv WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16862
train
v3
Schema: transactions (alias: txn)(id, name, code, value) branches(salary, date, amount, value) Task: Find value from transactions where amount exceeds the total amount from branches for the same level. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16863
train
v1
Schema: tasks (alias: tsk)(value, status, date, amount) sales(salary, date, type, code) Task: Select salary from tasks where type exists in sales for the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16864
train
v3
Schema: departments (alias: dept)(type, id, amount, status) items(name, type, status, date) Task: Find value from departments where value exceeds the count of amount from items for the same level. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = dept.level );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "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_16865
train
v1
Schema: accounts (alias: acct)(code, value, amount, type) employees(value, name, salary, amount) Task: Retrieve value from accounts whose id is found in employees rows where status matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16866
train
v3
Schema: staff (alias: empl)(status, value, code, level) items(date, value, name, salary) Task: Find id from staff where value exceeds the total salary from items for the same status. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16867
train
v3
Schema: items (alias: lne)(id, amount, type, salary) orders(code, date, value, name) Task: Retrieve name from items with salary above the AVG(amount) of orders rows sharing the same code. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16868
train
v3
Schema: regions (alias: rgn)(level, type, status, date) categories(salary, value, date, type) Task: Find value from regions where amount exceeds the maximum salary from categories for the same type. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.type = rgn.type );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16869
train
v3
Schema: categories (alias: catg)(date, type, code, name) requests(code, name, id, type) Task: Find amount from categories where amount exceeds the count of value from requests for the same code. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.code = catg.code );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16870
train
v2
Schema: items (alias: lne)(date, amount, id, salary) invoices(level, date, status, amount) Task: Retrieve amount from items that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = lne.type );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16871
train
v1
Schema: sales (alias: sale)(amount, date, id, type) shipments(salary, amount, status, level) Task: Retrieve value from sales whose status is found in shipments rows where type matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16872
train
v1
Schema: regions (alias: rgn)(name, type, amount, code) shipments(code, id, type, salary) Task: Select value from regions where level exists in shipments for the same code. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16873
train
v2
Schema: accounts (alias: acct)(amount, type, level, code) shipments(status, value, level, salary) Task: Find code from accounts where a matching record exists in shipments with the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16874
train
v2
Schema: customers (alias: cust)(code, salary, value, level) orders(salary, code, id, status) Task: Retrieve code from customers that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16875
train
v3
Schema: categories (alias: catg)(value, type, date, id) customers(name, value, salary, id) Task: Find name from categories where amount exceeds the maximum salary from customers for the same id. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.id = catg.id );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16876
train
v1
Schema: products (alias: prod)(amount, date, level, type) orders(type, amount, level, code) Task: Find name from products where status appears in orders entries with matching level. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16877
train
v1
Schema: managers (alias: mgr)(code, id, level, type) shipments(code, amount, date, salary) Task: Find code from managers where type appears in shipments entries with matching type. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16878
train
v2
Schema: managers (alias: mgr)(salary, name, date, amount) categories(amount, code, value, id) Task: Find code from managers where a matching record exists in categories with the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = mgr.type );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16879
train
v1
Schema: customers (alias: cust)(date, type, amount, salary) products(code, name, type, status) Task: Find salary from customers where id appears in products entries with matching code. SQL:
SELECT salary FROM customers AS cust WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16880
train
v3
Schema: projects (alias: prj)(date, code, value, status) categories(amount, name, value, id) Task: Find amount from projects where salary exceeds the average amount from categories for the same id. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.id = prj.id );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16881
train
v1
Schema: categories (alias: catg)(code, status, type, value) items(amount, value, level, name) Task: Select value from categories where id exists in items for the same id. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16882
train
v2
Schema: employees (alias: emp)(name, code, id, amount) orders(id, code, status, name) Task: Find amount from employees where a matching record exists in orders with the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16883
train
v3
Schema: sales (alias: sale)(date, type, status, code) orders(date, amount, status, id) Task: Find amount from sales where amount exceeds the average salary from orders for the same status. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16884
train
v2
Schema: sales (alias: sale)(status, level, salary, name) departments(code, type, id, date) Task: Retrieve value from sales that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16885
train
v2
Schema: employees (alias: emp)(status, date, value, id) orders(id, level, amount, value) Task: Find amount from employees where a matching record exists in orders with the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16886
train
v2
Schema: employees (alias: emp)(code, name, amount, value) orders(name, id, date, level) Task: Retrieve id from employees that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16887
train
v1
Schema: projects (alias: prj)(salary, id, status, code) shipments(salary, level, code, name) Task: Retrieve value from projects whose type is found in shipments rows where level matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = prj.level );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16888
train
v1
Schema: employees (alias: emp)(salary, value, date, level) sales(type, code, level, salary) Task: Find name from employees where id appears in sales entries with matching type. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16889
train
v2
Schema: employees (alias: emp)(level, date, salary, amount) schedules(level, type, status, salary) Task: Retrieve code from employees that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT code 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": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16890
train
v2
Schema: requests (alias: ordr)(status, type, id, date) items(name, salary, status, level) Task: Find amount from requests where a matching record exists in items with the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = ordr.id );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16891
train
v3
Schema: schedules (alias: schd)(date, id, amount, code) requests(salary, type, id, name) Task: Retrieve id from schedules with salary above the SUM(salary) of requests rows sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16892
train
v1
Schema: transactions (alias: txn)(name, level, salary, id) items(id, level, date, code) Task: Retrieve value from transactions whose level is found in items rows where level matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16893
train
v3
Schema: regions (alias: rgn)(value, name, salary, date) employees(status, amount, date, id) Task: Retrieve salary from regions with value above the MAX(value) of employees rows sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16894
train
v2
Schema: staff (alias: empl)(id, status, date, level) managers(id, salary, code, status) Task: Retrieve amount from staff that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16895
train
v1
Schema: categories (alias: catg)(type, salary, amount, code) regions(name, date, status, id) Task: Select id from categories where status exists in regions for the same status. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16896
train
v2
Schema: departments (alias: dept)(level, amount, id, code) transactions(id, salary, date, code) Task: Retrieve salary from departments that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = dept.code );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16897
train
v1
Schema: employees (alias: emp)(code, type, date, level) staff(name, date, level, id) Task: Retrieve value from employees whose id is found in staff rows where status matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16898
train
v1
Schema: products (alias: prod)(code, type, status, salary) orders(amount, type, id, level) Task: Find code from products where status appears in orders entries with matching type. SQL:
SELECT code FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = prod.type );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16899
train