variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v1
Schema: invoices (alias: inv)(salary, name, type, code) items(amount, value, id, level) Task: Retrieve id from invoices whose id is found in items rows where code matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id 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": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16100
train
v2
Schema: requests (alias: ordr)(id, salary, type, name) branches(level, amount, value, salary) Task: Find id from requests where a matching record exists in branches with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = ordr.level );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16101
train
v2
Schema: accounts (alias: acct)(value, code, amount, date) tasks(amount, id, code, status) Task: Retrieve id from accounts that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = acct.code );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16102
train
v1
Schema: departments (alias: dept)(date, level, salary, type) categories(code, date, salary, amount) Task: Find id from departments where level appears in categories entries with matching level. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16103
train
v1
Schema: orders (alias: ord)(value, amount, salary, id) customers(name, date, id, type) Task: Select amount from orders where code exists in customers for the same status. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = ord.status );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16104
train
v1
Schema: sales (alias: sale)(id, type, status, salary) departments(id, code, type, level) Task: Select salary from sales where code exists in departments for the same status. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16105
train
v1
Schema: schedules (alias: schd)(date, value, level, amount) shipments(value, amount, level, name) Task: Select value from schedules where id exists in shipments for the same code. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16106
train
v3
Schema: invoices (alias: inv)(type, date, name, level) items(id, date, level, amount) Task: Find amount from invoices where value exceeds the count of salary from items for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16107
train
v1
Schema: products (alias: prod)(amount, status, type, salary) transactions(date, salary, code, type) Task: Find amount from products where level appears in transactions entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16108
train
v2
Schema: regions (alias: rgn)(level, name, amount, value) accounts(id, code, amount, type) Task: Retrieve amount from regions that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16109
train
v1
Schema: shipments (alias: shp)(level, amount, status, value) managers(name, value, status, date) Task: Find id from shipments where code appears in managers entries with matching level. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_16110
train
v1
Schema: schedules (alias: schd)(type, value, status, name) regions(id, code, status, value) Task: Find name from schedules where type appears in regions entries with matching level. SQL:
SELECT name FROM schedules AS schd WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16111
train
v2
Schema: customers (alias: cust)(amount, status, date, type) staff(status, code, level, salary) Task: Retrieve code from customers that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16112
train
v1
Schema: branches (alias: brc)(code, name, amount, date) projects(type, code, amount, level) Task: Find name from branches where id appears in projects entries with matching code. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16113
train
v3
Schema: regions (alias: rgn)(type, level, id, date) projects(value, code, salary, date) Task: Retrieve name from regions with amount above the MIN(value) of projects rows sharing the same code. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM projects AS prj WHERE prj.code = rgn.code );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16114
train
v1
Schema: employees (alias: emp)(salary, type, date, id) staff(id, name, status, salary) Task: Find amount from employees where status appears in staff entries with matching status. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16115
train
v3
Schema: requests (alias: ordr)(date, id, name, level) categories(amount, code, salary, date) Task: Find code from requests where value exceeds the maximum amount from categories for the same status. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16116
train
v2
Schema: categories (alias: catg)(amount, level, type, code) tasks(name, id, code, salary) Task: Retrieve name from categories that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16117
train
v1
Schema: employees (alias: emp)(date, status, code, salary) departments(amount, type, status, value) Task: Retrieve name from employees whose id is found in departments rows where code matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16118
train
v3
Schema: projects (alias: prj)(status, code, salary, amount) products(type, date, status, level) Task: Find amount from projects where amount exceeds the total salary from products for the same status. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.status = prj.status );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16119
train
v3
Schema: branches (alias: brc)(salary, amount, code, name) accounts(level, salary, status, type) Task: Retrieve amount from branches with salary above the MIN(value) of accounts rows sharing the same status. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.status = brc.status );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16120
train
v1
Schema: projects (alias: prj)(level, salary, value, id) sales(code, name, value, type) Task: Select value from projects where code exists in sales for the same id. SQL:
SELECT value FROM projects AS prj WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = prj.id );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16121
train
v3
Schema: tasks (alias: tsk)(id, code, value, name) accounts(type, id, name, date) Task: Find salary from tasks where salary exceeds the minimum salary from accounts for the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16122
train
v3
Schema: products (alias: prod)(status, level, id, amount) categories(code, value, level, amount) Task: Retrieve name from products with value above the MAX(value) of categories rows sharing the same status. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT MAX(value) FROM categories AS catg WHERE catg.status = prod.status );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16123
train
v1
Schema: sales (alias: sale)(level, amount, type, value) departments(amount, value, salary, id) Task: Select id from sales where level exists in departments for the same status. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16124
train
v3
Schema: managers (alias: mgr)(amount, salary, level, value) staff(id, level, value, date) Task: Find id from managers where salary exceeds the count of value from staff for the same id. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16125
train
v2
Schema: employees (alias: emp)(type, level, code, value) accounts(value, status, id, amount) Task: Find name from employees where a matching record exists in accounts with the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16126
train
v3
Schema: customers (alias: cust)(name, salary, type, date) schedules(date, id, type, name) Task: Retrieve salary from customers with amount above the AVG(amount) of schedules rows sharing the same id. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.id = cust.id );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16127
train
v3
Schema: staff (alias: empl)(value, status, name, date) orders(name, level, id, amount) Task: Find name from staff where amount exceeds the total value from orders for the same id. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16128
train
v1
Schema: employees (alias: emp)(status, value, amount, name) items(level, date, code, name) Task: Retrieve salary from employees whose type is found in items rows where status matches the outer record. SQL:
SELECT salary FROM employees AS emp WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16129
train
v2
Schema: transactions (alias: txn)(amount, value, name, date) staff(status, value, amount, type) Task: Find code from transactions where a matching record exists in staff with the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16130
train
v1
Schema: orders (alias: ord)(id, amount, value, date) invoices(date, salary, amount, name) Task: Find amount from orders where type appears in invoices entries with matching id. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16131
train
v2
Schema: items (alias: lne)(id, type, salary, name) customers(id, type, level, salary) Task: Find amount from items where a matching record exists in customers with the same code. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = lne.code );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16132
train
v3
Schema: regions (alias: rgn)(type, salary, name, status) staff(name, code, status, value) Task: Retrieve name from regions with value above the AVG(salary) of staff rows sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = rgn.id );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16133
train
v3
Schema: schedules (alias: schd)(code, type, date, amount) departments(name, id, value, date) Task: Find amount from schedules where value exceeds the minimum amount from departments for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.code = schd.code );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16134
train
v2
Schema: staff (alias: empl)(salary, type, value, status) projects(salary, status, level, type) Task: Retrieve amount from staff that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = empl.code );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16135
train
v2
Schema: regions (alias: rgn)(date, level, status, code) customers(code, name, salary, level) Task: Retrieve name from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16136
train
v2
Schema: managers (alias: mgr)(value, id, amount, name) sales(amount, salary, type, name) Task: Find value from managers where a matching record exists in sales with the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = mgr.type );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16137
train
v1
Schema: items (alias: lne)(salary, type, amount, name) categories(value, amount, status, id) Task: Select id from items where type exists in categories for the same status. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = lne.status );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16138
train
v1
Schema: items (alias: lne)(status, amount, name, type) managers(name, salary, id, amount) Task: Find id from items where type appears in managers entries with matching level. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16139
train
v2
Schema: accounts (alias: acct)(value, id, type, code) products(name, date, salary, level) Task: Find salary from accounts where a matching record exists in products with the same status. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16140
train
v2
Schema: requests (alias: ordr)(code, level, date, amount) branches(id, type, date, name) Task: Retrieve value from requests that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16141
train
v1
Schema: tasks (alias: tsk)(salary, code, id, amount) accounts(name, salary, value, level) Task: Retrieve salary from tasks whose type is found in accounts rows where status matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16142
train
v1
Schema: customers (alias: cust)(id, status, amount, date) accounts(amount, date, level, type) Task: Select amount from customers where status exists in accounts for the same level. SQL:
SELECT amount FROM customers AS cust WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16143
train
v3
Schema: departments (alias: dept)(code, name, type, date) accounts(name, level, id, value) Task: Retrieve value from departments with salary above the MAX(salary) of accounts rows sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16144
train
v1
Schema: orders (alias: ord)(name, salary, value, type) transactions(id, type, level, date) Task: Find salary from orders where code appears in transactions entries with matching code. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16145
train
v2
Schema: tasks (alias: tsk)(amount, type, id, level) orders(code, status, amount, value) Task: Find salary from tasks where a matching record exists in orders with the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16146
train
v2
Schema: regions (alias: rgn)(id, status, salary, name) orders(level, type, code, salary) Task: Retrieve salary from regions that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16147
train
v1
Schema: products (alias: prod)(type, name, salary, id) invoices(name, type, level, date) Task: Retrieve name from products whose code is found in invoices rows where level matches the outer record. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16148
train
v2
Schema: items (alias: lne)(name, level, amount, salary) sales(id, salary, code, date) Task: Retrieve amount from items that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = lne.level );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16149
train
v2
Schema: sales (alias: sale)(level, status, name, value) regions(name, status, type, id) Task: Retrieve id from sales that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16150
train
v3
Schema: orders (alias: ord)(date, amount, code, salary) items(amount, name, value, type) Task: Retrieve id from orders with value above the COUNT(value) of items rows sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16151
train
v2
Schema: managers (alias: mgr)(date, value, type, id) regions(amount, status, type, date) Task: Retrieve value from managers that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16152
train
v1
Schema: categories (alias: catg)(level, type, status, id) tasks(salary, level, id, name) Task: Find id from categories where status appears in tasks entries with matching code. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16153
train
v1
Schema: employees (alias: emp)(level, amount, salary, date) transactions(id, date, level, amount) Task: Find name from employees where level appears in transactions entries with matching type. SQL:
SELECT name FROM employees AS emp WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16154
train
v3
Schema: departments (alias: dept)(level, code, date, name) products(id, amount, level, code) Task: Retrieve value from departments with value above the MIN(value) of products rows sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM products AS prod WHERE prod.code = dept.code );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16155
train
v2
Schema: sales (alias: sale)(status, level, amount, value) projects(name, code, salary, date) Task: Find value from sales where a matching record exists in projects with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16156
train
v2
Schema: invoices (alias: inv)(status, id, salary, value) categories(status, value, date, code) Task: Find code from invoices where a matching record exists in categories with the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16157
train
v2
Schema: products (alias: prod)(status, id, date, name) accounts(amount, date, level, salary) Task: Find code from products where a matching record exists in accounts with the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16158
train
v1
Schema: products (alias: prod)(name, status, date, id) customers(salary, name, value, amount) Task: Find id from products where type appears in customers entries with matching id. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16159
train
v2
Schema: projects (alias: prj)(type, name, level, date) shipments(value, id, type, date) Task: Find salary from projects where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = prj.status );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16160
train
v1
Schema: items (alias: lne)(type, amount, value, id) transactions(type, id, status, salary) Task: Select salary from items where id exists in transactions for the same level. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16161
train
v3
Schema: orders (alias: ord)(salary, type, id, value) invoices(amount, code, value, type) Task: Retrieve code from orders with salary above the SUM(amount) of invoices rows sharing the same level. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16162
train
v3
Schema: projects (alias: prj)(level, salary, amount, id) categories(code, name, type, level) Task: Retrieve name from projects with salary above the MIN(salary) of categories rows sharing the same status. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.status = prj.status );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16163
train
v3
Schema: departments (alias: dept)(status, code, value, id) requests(status, amount, type, name) Task: Retrieve salary from departments with amount above the SUM(amount) of requests rows sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16164
train
v3
Schema: projects (alias: prj)(value, level, status, name) accounts(level, code, amount, value) Task: Find id from projects where value exceeds the count of salary from accounts for the same status. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.status = prj.status );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16165
train
v1
Schema: invoices (alias: inv)(name, date, code, level) employees(status, salary, type, code) Task: Find value from invoices where id appears in employees entries with matching id. SQL:
SELECT value FROM invoices AS inv WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16166
train
v3
Schema: customers (alias: cust)(value, type, salary, name) accounts(name, salary, value, id) Task: Find salary from customers where salary exceeds the minimum value from accounts for the same status. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16167
train
v1
Schema: requests (alias: ordr)(status, level, code, amount) orders(value, name, amount, type) Task: Retrieve code from requests whose id is found in orders rows where code matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16168
train
v3
Schema: employees (alias: emp)(status, name, level, id) requests(name, code, type, date) Task: Find amount from employees where amount exceeds the maximum value from requests for the same code. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16169
train
v3
Schema: requests (alias: ordr)(salary, code, name, level) departments(id, value, name, date) Task: Retrieve salary from requests with salary above the MIN(value) of departments rows sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT MIN(value) FROM departments AS dept WHERE dept.id = ordr.id );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16170
train
v3
Schema: accounts (alias: acct)(date, code, value, amount) branches(name, amount, level, date) Task: Retrieve code from accounts with value above the AVG(value) of branches rows sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT AVG(value) FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16171
train
v3
Schema: items (alias: lne)(status, value, date, type) products(salary, date, value, amount) Task: Find code from items where salary exceeds the maximum amount from products for the same type. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT MAX(amount) FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16172
train
v3
Schema: managers (alias: mgr)(value, id, level, status) projects(type, value, id, name) Task: Find salary from managers where amount exceeds the minimum amount from projects for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.code = mgr.code );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16173
train
v1
Schema: managers (alias: mgr)(level, salary, value, name) tasks(status, amount, type, name) Task: Find code from managers where status appears in tasks entries with matching type. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.type = mgr.type );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16174
train
v3
Schema: employees (alias: emp)(date, value, level, status) items(salary, name, value, id) Task: Retrieve name from employees with amount above the SUM(amount) of items rows sharing the same level. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT SUM(amount) FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16175
train
v2
Schema: staff (alias: empl)(salary, value, type, date) transactions(date, code, level, id) Task: Find id from staff where a matching record exists in transactions with the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16176
train
v2
Schema: branches (alias: brc)(salary, value, code, level) requests(amount, type, salary, id) Task: Retrieve name from branches that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = brc.status );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16177
train
v2
Schema: accounts (alias: acct)(status, value, amount, name) projects(salary, level, value, amount) Task: Retrieve id from accounts that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16178
train
v3
Schema: requests (alias: ordr)(value, type, date, level) invoices(status, id, date, salary) Task: Retrieve name from requests with value above the SUM(amount) of invoices rows sharing the same id. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16179
train
v2
Schema: customers (alias: cust)(value, name, type, amount) invoices(id, type, name, value) Task: Find value from customers where a matching record exists in invoices with the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16180
train
v3
Schema: sales (alias: sale)(id, code, amount, date) shipments(type, salary, level, id) Task: Find amount from sales where amount exceeds the minimum salary from shipments for the same type. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "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_16181
train
v1
Schema: invoices (alias: inv)(name, type, id, code) employees(level, salary, status, amount) Task: Select amount from invoices where level exists in employees for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16182
train
v1
Schema: projects (alias: prj)(date, status, id, level) branches(date, type, value, salary) Task: Find salary from projects where type appears in branches entries with matching code. SQL:
SELECT salary FROM projects AS prj WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = prj.code );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16183
train
v2
Schema: orders (alias: ord)(id, status, code, level) managers(id, date, amount, name) Task: Find amount from orders where a matching record exists in managers with the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16184
train
v2
Schema: products (alias: prod)(amount, code, date, level) orders(status, type, salary, date) Task: Find code from products where a matching record exists in orders with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16185
train
v1
Schema: regions (alias: rgn)(name, value, salary, amount) requests(status, value, type, code) Task: Find code from regions where id appears in requests entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16186
train
v2
Schema: staff (alias: empl)(type, status, amount, code) regions(amount, type, status, date) Task: Find amount from staff where a matching record exists in regions with the same status. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16187
train
v1
Schema: departments (alias: dept)(code, type, status, salary) customers(salary, level, status, date) Task: Find value from departments where id appears in customers entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16188
train
v1
Schema: orders (alias: ord)(id, date, amount, code) schedules(level, code, status, amount) Task: Select value from orders where type exists in schedules for the same code. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16189
train
v2
Schema: products (alias: prod)(id, salary, type, code) transactions(status, level, id, code) Task: Retrieve value from products that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16190
train
v3
Schema: managers (alias: mgr)(level, value, date, id) products(name, value, type, level) Task: Retrieve id from managers with salary above the MIN(salary) of products rows sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT MIN(salary) FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16191
train
v1
Schema: departments (alias: dept)(level, salary, type, value) items(type, salary, amount, id) Task: Select id from departments where code exists in items for the same id. SQL:
SELECT id FROM departments AS dept WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16192
train
v1
Schema: branches (alias: brc)(value, status, id, amount) categories(date, value, type, salary) Task: Find amount from branches where level appears in categories entries with matching id. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = brc.id );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16193
train
v2
Schema: regions (alias: rgn)(name, value, date, type) orders(id, level, value, status) Task: Retrieve name from regions that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16194
train
v1
Schema: regions (alias: rgn)(salary, code, level, status) products(status, type, code, id) Task: Retrieve name from regions whose level is found in products rows where code matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16195
train
v1
Schema: schedules (alias: schd)(name, type, salary, level) transactions(date, level, salary, status) Task: Find code from schedules where status appears in transactions entries with matching id. SQL:
SELECT code FROM schedules AS schd WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16196
train
v3
Schema: items (alias: lne)(id, date, salary, name) staff(salary, code, amount, name) Task: Retrieve salary from items with value above the AVG(amount) of staff rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16197
train
v2
Schema: sales (alias: sale)(name, status, value, amount) managers(status, level, id, name) Task: Retrieve value from sales that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16198
train
v2
Schema: employees (alias: emp)(salary, id, name, value) customers(value, type, code, name) Task: Retrieve code from employees that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16199
train