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)(status, salary, level, value) invoices(amount, status, name, value) Task: Retrieve value from transactions with value above the MIN(amount) of invoices rows sharing the same status. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13900
train
v1
Schema: tasks (alias: tsk)(id, status, salary, level) branches(type, code, status, date) Task: Find name from tasks where level appears in branches entries with matching code. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13901
train
v3
Schema: sales (alias: sale)(code, status, date, amount) transactions(status, amount, type, date) Task: Retrieve amount from sales with amount above the MIN(salary) of transactions rows sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13902
train
v1
Schema: transactions (alias: txn)(status, value, code, type) invoices(date, name, code, level) Task: Find value from transactions where type appears in invoices entries with matching level. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = txn.level );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13903
train
v3
Schema: employees (alias: emp)(value, status, salary, level) customers(name, type, id, amount) Task: Retrieve code from employees with amount above the COUNT(salary) of customers rows sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13904
train
v2
Schema: schedules (alias: schd)(level, amount, date, name) managers(level, salary, status, type) Task: Find value from schedules where a matching record exists in managers with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13905
train
v2
Schema: employees (alias: emp)(value, code, amount, level) shipments(type, value, amount, date) Task: Retrieve code from employees that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13906
train
v1
Schema: requests (alias: ordr)(level, status, id, amount) regions(status, date, id, value) Task: Select salary from requests where status exists in regions for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13907
train
v1
Schema: projects (alias: prj)(amount, value, id, name) requests(value, salary, type, date) Task: Retrieve value from projects whose code is found in requests rows where level matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.level = prj.level );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13908
train
v1
Schema: branches (alias: brc)(status, amount, type, name) customers(value, amount, code, level) Task: Find code from branches where code appears in customers entries with matching type. SQL:
SELECT code FROM branches AS brc WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13909
train
v2
Schema: categories (alias: catg)(code, salary, value, name) shipments(level, date, name, amount) Task: Find salary from categories where a matching record exists in shipments with the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = catg.type );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13910
train
v1
Schema: tasks (alias: tsk)(level, status, type, amount) managers(status, name, type, amount) Task: Select salary from tasks where type exists in managers for the same status. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13911
train
v2
Schema: managers (alias: mgr)(level, type, value, amount) orders(salary, name, type, code) Task: Find code from managers where a matching record exists in orders with the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = mgr.level );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13912
train
v2
Schema: requests (alias: ordr)(salary, id, level, status) departments(date, name, code, level) Task: Retrieve salary from requests that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13913
train
v1
Schema: accounts (alias: acct)(salary, status, code, name) categories(salary, date, type, amount) Task: Find salary from accounts where level appears in categories entries with matching type. SQL:
SELECT salary FROM accounts AS acct WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13914
train
v2
Schema: branches (alias: brc)(amount, level, date, name) invoices(code, date, amount, name) Task: Find name from branches where a matching record exists in invoices with the same status. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = brc.status );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "name", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13915
train
v1
Schema: accounts (alias: acct)(type, date, name, amount) sales(type, amount, name, date) Task: Retrieve amount from accounts whose level is found in sales rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13916
train
v3
Schema: invoices (alias: inv)(amount, level, value, date) managers(status, type, amount, salary) Task: Find name from invoices where amount exceeds the average amount from managers for the same code. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13917
train
v1
Schema: regions (alias: rgn)(level, status, amount, date) branches(date, level, amount, code) Task: Select value from regions where code exists in branches for the same status. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13918
train
v3
Schema: shipments (alias: shp)(salary, amount, name, type) items(amount, type, level, name) Task: Find value from shipments where amount exceeds the average salary from items for the same id. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.id = shp.id );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13919
train
v3
Schema: items (alias: lne)(value, name, amount, salary) orders(amount, name, value, level) Task: Retrieve name from items with value above the MIN(value) of orders rows sharing the same id. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT MIN(value) FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13920
train
v1
Schema: departments (alias: dept)(code, salary, date, type) items(name, date, amount, type) Task: Select name from departments where status exists in items for the same type. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13921
train
v3
Schema: schedules (alias: schd)(code, value, type, id) categories(status, value, name, date) Task: Find value from schedules where salary exceeds the count of salary from categories for the same type. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13922
train
v1
Schema: branches (alias: brc)(level, date, type, value) employees(id, date, type, value) Task: Retrieve code from branches whose status is found in employees rows where code matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = brc.code );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13923
train
v3
Schema: projects (alias: prj)(name, level, salary, amount) items(amount, id, level, code) Task: Retrieve code from projects with amount above the SUM(amount) of items rows sharing the same level. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT SUM(amount) FROM items AS lne WHERE lne.level = prj.level );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13924
train
v3
Schema: items (alias: lne)(type, salary, level, status) projects(name, code, value, id) Task: Retrieve id from items with amount above the MIN(amount) of projects rows sharing the same status. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.status = lne.status );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13925
train
v1
Schema: regions (alias: rgn)(status, type, salary, value) tasks(amount, salary, id, code) Task: Find code from regions where code appears in tasks entries with matching code. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13926
train
v1
Schema: tasks (alias: tsk)(level, name, status, id) products(name, type, code, level) Task: Find name from tasks where level appears in products entries with matching status. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13927
train
v1
Schema: customers (alias: cust)(code, id, value, type) transactions(type, name, code, value) Task: Select amount from customers where type exists in transactions for the same id. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13928
train
v3
Schema: transactions (alias: txn)(level, amount, id, name) employees(name, status, level, date) Task: Retrieve salary from transactions with salary above the SUM(amount) of employees rows sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13929
train
v2
Schema: schedules (alias: schd)(name, code, date, value) employees(code, type, value, status) Task: Retrieve code from schedules that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13930
train
v2
Schema: transactions (alias: txn)(date, salary, id, level) products(status, id, amount, code) Task: Retrieve name from transactions that have at least one corresponding entry in products sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13931
train
v2
Schema: managers (alias: mgr)(date, amount, salary, name) tasks(level, salary, code, value) Task: Find salary from managers where a matching record exists in tasks with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = mgr.id );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13932
train
v3
Schema: orders (alias: ord)(amount, level, name, date) sales(code, value, type, amount) Task: Retrieve amount from orders with value above the SUM(value) of sales rows sharing the same level. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT SUM(value) FROM sales AS sale WHERE sale.level = ord.level );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13933
train
v3
Schema: tasks (alias: tsk)(id, type, date, name) accounts(code, value, salary, status) Task: Retrieve amount from tasks with amount above the MAX(value) of accounts rows sharing the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE amount > ( SELECT MAX(value) 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": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13934
train
v3
Schema: categories (alias: catg)(code, status, value, level) staff(amount, status, code, id) Task: Retrieve name from categories with value above the MAX(amount) of staff rows sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13935
train
v1
Schema: invoices (alias: inv)(date, id, status, amount) employees(type, date, code, status) Task: Retrieve code from invoices whose id is found in employees rows where status matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13936
train
v3
Schema: managers (alias: mgr)(level, type, value, name) employees(value, name, code, amount) Task: Find salary from managers where salary exceeds the total salary from employees for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13937
train
v3
Schema: transactions (alias: txn)(name, level, type, date) branches(amount, date, salary, value) Task: Find name from transactions where amount exceeds the minimum value from branches for the same type. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM branches AS brc WHERE brc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13938
train
v2
Schema: departments (alias: dept)(amount, level, name, status) managers(status, code, date, name) Task: Retrieve name from departments that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = dept.level );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13939
train
v2
Schema: transactions (alias: txn)(name, code, value, date) products(type, level, code, value) Task: Retrieve name from transactions that have at least one corresponding entry in products sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13940
train
v2
Schema: accounts (alias: acct)(type, amount, salary, date) products(amount, level, date, code) Task: Find code from accounts where a matching record exists in products with the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = acct.type );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13941
train
v1
Schema: employees (alias: emp)(level, id, code, salary) branches(salary, type, date, level) Task: Select code from employees where id exists in branches for the same status. SQL:
SELECT code FROM employees AS emp WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = emp.status );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13942
train
v1
Schema: staff (alias: empl)(salary, date, value, status) departments(value, type, name, id) Task: Retrieve name from staff whose status is found in departments rows where status matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13943
train
v1
Schema: accounts (alias: acct)(id, type, level, salary) items(amount, date, status, type) Task: Retrieve name from accounts whose code is found in items rows where id matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13944
train
v2
Schema: items (alias: lne)(salary, name, status, code) branches(value, level, amount, name) Task: Find salary from items where a matching record exists in branches with the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = lne.id );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13945
train
v1
Schema: accounts (alias: acct)(date, name, value, salary) regions(name, code, date, value) Task: Select value from accounts where status exists in regions for the same type. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13946
train
v2
Schema: shipments (alias: shp)(name, value, id, level) transactions(code, status, date, amount) Task: Find salary from shipments where a matching record exists in transactions with the same id. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13947
train
v3
Schema: items (alias: lne)(type, date, salary, level) transactions(id, type, date, amount) Task: Find amount from items where salary exceeds the average amount from transactions for the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_13948
train
v1
Schema: customers (alias: cust)(status, code, value, id) requests(amount, type, status, id) Task: Select salary from customers where code exists in requests for the same code. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13949
train
v3
Schema: customers (alias: cust)(level, status, value, type) invoices(value, code, level, salary) Task: Find id from customers where value exceeds the maximum amount from invoices for the same code. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13950
train
v3
Schema: accounts (alias: acct)(value, date, name, code) sales(date, salary, id, type) Task: Find code from accounts where amount exceeds the total salary from sales for the same id. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.id = acct.id );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13951
train
v3
Schema: managers (alias: mgr)(date, name, code, type) orders(value, amount, salary, code) Task: Retrieve amount from managers with value above the MAX(value) of orders rows sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MAX(value) FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13952
train
v3
Schema: categories (alias: catg)(status, name, type, amount) requests(code, level, date, value) Task: Find name from categories where salary exceeds the minimum amount from requests for the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.level = catg.level );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13953
train
v1
Schema: orders (alias: ord)(code, id, name, type) customers(type, code, name, date) Task: Find amount from orders where type appears in customers entries with matching id. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13954
train
v1
Schema: shipments (alias: shp)(salary, level, code, date) managers(amount, type, value, id) Task: Select name from shipments where code exists in managers for the same code. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13955
train
v1
Schema: schedules (alias: schd)(date, level, id, value) transactions(type, name, amount, value) Task: Retrieve value from schedules whose type is found in transactions rows where id matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13956
train
v1
Schema: projects (alias: prj)(status, name, salary, id) transactions(value, level, type, id) Task: Find name from projects where type appears in transactions entries with matching status. SQL:
SELECT name FROM projects AS prj WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = prj.status );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13957
train
v1
Schema: staff (alias: empl)(amount, type, name, status) projects(level, status, id, date) Task: Select name from staff where status exists in projects for the same status. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13958
train
v1
Schema: tasks (alias: tsk)(type, name, level, date) managers(level, salary, code, name) Task: Select amount from tasks where id exists in managers for the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13959
train
v1
Schema: customers (alias: cust)(salary, status, level, name) branches(code, salary, status, amount) Task: Select code from customers where code exists in branches for the same id. SQL:
SELECT code FROM customers AS cust WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = cust.id );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13960
train
v2
Schema: customers (alias: cust)(amount, name, salary, date) items(status, amount, id, salary) Task: Find name from customers where a matching record exists in items with the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = cust.level );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13961
train
v1
Schema: requests (alias: ordr)(amount, status, value, type) managers(date, type, amount, code) Task: Select amount from requests where type exists in managers for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13962
train
v2
Schema: customers (alias: cust)(status, level, value, code) requests(value, level, status, type) Task: Find id from customers where a matching record exists in requests with the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13963
train
v2
Schema: requests (alias: ordr)(id, name, level, amount) tasks(amount, salary, name, code) Task: Find id from requests where a matching record exists in tasks with the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = ordr.status );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13964
train
v3
Schema: sales (alias: sale)(status, value, date, level) categories(value, type, salary, amount) Task: Retrieve id from sales with amount above the SUM(amount) of categories rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13965
train
v1
Schema: sales (alias: sale)(id, code, amount, level) regions(type, value, amount, name) Task: Select value from sales where level exists in regions for the same status. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level 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": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13966
train
v1
Schema: categories (alias: catg)(name, type, level, status) regions(status, level, name, code) Task: Find value from categories where level appears in regions entries with matching code. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = catg.code );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13967
train
v2
Schema: orders (alias: ord)(date, salary, value, status) staff(code, date, id, name) Task: Find id from orders where a matching record exists in staff with the same type. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13968
train
v1
Schema: schedules (alias: schd)(level, name, salary, value) categories(code, name, status, salary) Task: Select amount from schedules where code exists in categories for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13969
train
v1
Schema: projects (alias: prj)(level, salary, value, code) employees(type, salary, date, status) Task: Select salary from projects where code exists in employees for the same type. SQL:
SELECT salary FROM projects AS prj WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = prj.type );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13970
train
v3
Schema: orders (alias: ord)(name, id, type, date) transactions(amount, level, type, status) Task: Retrieve value from orders with amount above the AVG(amount) of transactions rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13971
train
v1
Schema: projects (alias: prj)(name, date, level, type) categories(status, salary, name, level) Task: Retrieve salary from projects whose id is found in categories rows where status matches the outer record. SQL:
SELECT salary FROM projects AS prj WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = prj.status );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13972
train
v3
Schema: tasks (alias: tsk)(id, name, amount, code) items(date, level, name, value) Task: Find salary from tasks where salary exceeds the maximum value from items for the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT MAX(value) FROM items AS lne WHERE lne.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_13973
train
v3
Schema: accounts (alias: acct)(type, code, date, level) transactions(salary, level, type, name) Task: Find name from accounts where value exceeds the maximum value from transactions for the same id. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13974
train
v1
Schema: regions (alias: rgn)(status, name, value, code) managers(code, type, status, name) Task: Find amount from regions where code appears in managers entries with matching status. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_13975
train
v1
Schema: shipments (alias: shp)(name, id, amount, value) sales(type, code, name, id) Task: Select amount from shipments where status exists in sales for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = shp.status );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13976
train
v2
Schema: products (alias: prod)(code, name, salary, id) categories(value, type, code, amount) Task: Find code from products where a matching record exists in categories with the same type. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prod.type );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13977
train
v1
Schema: branches (alias: brc)(date, type, salary, status) schedules(type, status, name, amount) Task: Find name from branches where id appears in schedules entries with matching type. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = brc.type );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13978
train
v3
Schema: projects (alias: prj)(name, amount, value, code) orders(status, value, amount, id) Task: Retrieve salary from projects with value above the AVG(value) of orders rows sharing the same type. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT AVG(value) FROM orders AS ord WHERE ord.type = prj.type );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_13979
train
v3
Schema: employees (alias: emp)(status, value, name, code) customers(code, amount, level, date) Task: Retrieve value from employees with amount above the COUNT(amount) of customers rows sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13980
train
v3
Schema: departments (alias: dept)(id, code, name, level) items(amount, name, code, id) Task: Find salary from departments where value exceeds the total salary from items for the same code. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13981
train
v1
Schema: accounts (alias: acct)(id, type, level, name) products(type, date, salary, code) Task: Find id from accounts where code appears in products entries with matching status. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13982
train
v3
Schema: categories (alias: catg)(value, amount, date, status) regions(value, name, id, code) Task: Find name from categories where amount exceeds the total value from regions for the same code. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.code = catg.code );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13983
train
v1
Schema: customers (alias: cust)(name, level, value, amount) products(status, name, date, type) Task: Find name from customers where level appears in products entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13984
train
v3
Schema: shipments (alias: shp)(status, code, salary, name) requests(salary, amount, status, date) Task: Retrieve code from shipments with value above the SUM(amount) of requests rows sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13985
train
v3
Schema: accounts (alias: acct)(salary, level, amount, date) shipments(name, amount, date, id) Task: Retrieve id from accounts with salary above the COUNT(salary) of shipments rows sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13986
train
v3
Schema: staff (alias: empl)(name, id, type, amount) invoices(status, type, amount, name) Task: Find salary from staff where salary exceeds the minimum value from invoices for the same type. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_13987
train
v2
Schema: branches (alias: brc)(value, name, level, date) departments(status, id, date, salary) Task: Retrieve amount from branches that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = brc.id );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_13988
train
v3
Schema: employees (alias: emp)(code, amount, name, level) categories(name, code, type, value) Task: Find name from employees where amount exceeds the total salary from categories for the same status. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.status = emp.status );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13989
train
v3
Schema: managers (alias: mgr)(date, status, level, id) regions(date, id, salary, name) Task: Find value from managers where salary exceeds the total salary from regions for the same code. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13990
train
v3
Schema: schedules (alias: schd)(code, id, level, status) tasks(code, salary, name, level) Task: Find value from schedules where salary exceeds the total amount from tasks for the same level. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.level = schd.level );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13991
train
v1
Schema: categories (alias: catg)(date, id, value, code) accounts(value, id, date, name) Task: Find name from categories where type appears in accounts entries with matching id. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13992
train
v3
Schema: shipments (alias: shp)(id, amount, date, level) customers(status, value, id, type) Task: Find salary from shipments where salary exceeds the maximum value from customers for the same code. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_13993
train
v3
Schema: managers (alias: mgr)(name, salary, id, level) invoices(status, value, level, date) Task: Find value from managers where amount exceeds the average amount from invoices for the same status. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.status = mgr.status );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13994
train
v1
Schema: accounts (alias: acct)(type, status, date, id) managers(date, level, salary, value) Task: Select value from accounts where status exists in managers for the same status. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13995
train
v2
Schema: categories (alias: catg)(value, level, salary, name) branches(value, salary, date, status) Task: Retrieve value from categories that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = catg.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_13996
train
v3
Schema: managers (alias: mgr)(name, status, amount, level) branches(date, code, value, id) Task: Retrieve name from managers with amount above the AVG(value) of branches rows sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT AVG(value) FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13997
train
v3
Schema: employees (alias: emp)(amount, level, id, type) invoices(name, date, value, salary) Task: Retrieve id from employees with amount above the COUNT(amount) of invoices rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_13998
train
v2
Schema: requests (alias: ordr)(id, value, salary, code) sales(level, id, salary, date) Task: Find id from requests where a matching record exists in sales with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = ordr.level );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_13999
train