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: customers (alias: cust)(date, name, id, type) projects(id, code, level, date) Task: Retrieve id from customers whose type is found in projects rows where status matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = cust.status );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08200
train
v2
Schema: departments (alias: dept)(type, id, code, status) accounts(code, amount, salary, level) Task: Retrieve id from departments that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = dept.status );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08201
train
v1
Schema: regions (alias: rgn)(status, code, type, salary) customers(status, name, code, type) Task: Retrieve name from regions whose id is found in customers rows where status matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08202
train
v1
Schema: shipments (alias: shp)(id, date, salary, status) products(level, date, salary, type) Task: Select id from shipments where type exists in products for the same code. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08203
train
v2
Schema: items (alias: lne)(date, value, level, code) requests(value, date, type, level) Task: Find amount from items where a matching record exists in requests with the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_08204
train
v2
Schema: staff (alias: empl)(code, value, name, type) requests(level, amount, type, date) Task: Retrieve value from staff that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08205
train
v2
Schema: customers (alias: cust)(code, value, status, amount) sales(salary, code, level, type) Task: Retrieve amount from customers that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08206
train
v3
Schema: transactions (alias: txn)(salary, date, amount, level) categories(code, id, amount, salary) Task: Retrieve name from transactions with amount above the SUM(amount) of categories rows sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08207
train
v1
Schema: sales (alias: sale)(amount, value, code, date) tasks(status, date, type, id) Task: Find salary from sales where id appears in tasks entries with matching status. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.status = sale.status );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08208
train
v3
Schema: sales (alias: sale)(type, id, level, value) schedules(code, value, date, level) Task: Find id from sales where value exceeds the total amount from schedules for the same type. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08209
train
v2
Schema: shipments (alias: shp)(status, name, date, code) accounts(date, status, salary, id) Task: Find id from shipments where a matching record exists in accounts with the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08210
train
v1
Schema: requests (alias: ordr)(amount, status, value, code) items(id, value, salary, status) Task: Select code from requests where code exists in items for the same type. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = ordr.type );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_08211
train
v1
Schema: transactions (alias: txn)(level, salary, id, status) orders(status, level, type, date) Task: Retrieve code from transactions whose status is found in orders rows where type matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = txn.type );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08212
train
v2
Schema: employees (alias: emp)(level, value, amount, code) customers(level, status, code, date) Task: Retrieve name from employees that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT name 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": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08213
train
v1
Schema: schedules (alias: schd)(id, amount, code, value) products(name, type, level, date) Task: Find value from schedules where code appears in products entries with matching type. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08214
train
v3
Schema: customers (alias: cust)(amount, id, date, type) tasks(salary, code, level, type) Task: Find value from customers where amount exceeds the average value from tasks for the same type. SQL:
SELECT value FROM customers AS cust WHERE amount > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.type = cust.type );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08215
train
v3
Schema: requests (alias: ordr)(amount, date, value, code) tasks(code, amount, id, name) Task: Find amount from requests where value exceeds the count of value from tasks for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM tasks AS tsk WHERE tsk.status = ordr.status );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_08216
train
v2
Schema: shipments (alias: shp)(code, date, level, type) customers(date, code, status, id) Task: Retrieve amount from shipments that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08217
train
v3
Schema: products (alias: prod)(salary, type, name, value) staff(level, amount, value, id) Task: Retrieve name from products with amount above the MIN(salary) of staff rows sharing the same id. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.id = prod.id );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08218
train
v2
Schema: tasks (alias: tsk)(level, value, date, name) schedules(type, date, salary, name) Task: Find id from tasks where a matching record exists in schedules with the same code. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_08219
train
v3
Schema: branches (alias: brc)(value, salary, type, status) projects(status, type, amount, name) Task: Retrieve value from branches with amount above the MIN(salary) of projects rows sharing the same code. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08220
train
v1
Schema: managers (alias: mgr)(salary, value, date, amount) products(amount, date, type, level) Task: Select code from managers where level exists in products for the same type. SQL:
SELECT code FROM managers AS mgr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08221
train
v3
Schema: regions (alias: rgn)(amount, type, date, status) staff(salary, id, name, level) Task: Retrieve id from regions with value above the MIN(salary) of staff rows sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08222
train
v1
Schema: customers (alias: cust)(status, type, amount, value) employees(status, id, value, amount) Task: Select id from customers where level exists in employees for the same status. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08223
train
v2
Schema: invoices (alias: inv)(type, date, amount, salary) projects(name, date, status, level) Task: Find id from invoices where a matching record exists in projects with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08224
train
v3
Schema: employees (alias: emp)(value, code, type, name) shipments(salary, value, id, status) Task: Find id from employees where amount exceeds the maximum value from shipments for the same type. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08225
train
v3
Schema: transactions (alias: txn)(date, value, status, type) sales(level, type, status, amount) Task: Find amount from transactions where amount exceeds the maximum salary from sales for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08226
train
v2
Schema: sales (alias: sale)(date, name, status, type) shipments(status, type, id, code) Task: Retrieve id from sales that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08227
train
v2
Schema: customers (alias: cust)(value, amount, id, code) tasks(code, date, name, salary) Task: Retrieve id from customers that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = cust.code );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08228
train
v2
Schema: transactions (alias: txn)(id, level, amount, type) managers(name, code, date, amount) Task: Retrieve id from transactions that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08229
train
v3
Schema: invoices (alias: inv)(salary, date, id, status) shipments(code, value, level, id) Task: Retrieve salary from invoices with value above the SUM(amount) of shipments rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08230
train
v2
Schema: projects (alias: prj)(code, level, date, type) transactions(status, date, type, level) Task: Find amount from projects where a matching record exists in transactions with the same level. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "amount", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08231
train
v3
Schema: items (alias: lne)(date, code, id, value) categories(code, amount, type, level) Task: Retrieve id from items with amount above the MIN(amount) of categories rows sharing the same id. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_08232
train
v1
Schema: regions (alias: rgn)(name, date, level, code) invoices(salary, date, level, amount) Task: Select value from regions where type exists in invoices for the same status. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08233
train
v3
Schema: schedules (alias: schd)(id, salary, value, code) requests(salary, amount, id, level) Task: Retrieve amount from schedules with amount above the MIN(salary) of requests rows sharing the same code. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08234
train
v3
Schema: tasks (alias: tsk)(value, salary, name, date) sales(salary, code, value, amount) Task: Retrieve amount from tasks with amount above the SUM(amount) of sales rows sharing the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE amount > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_08235
train
v2
Schema: transactions (alias: txn)(date, id, status, level) customers(status, value, salary, date) Task: Retrieve id from transactions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = txn.status );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08236
train
v1
Schema: sales (alias: sale)(status, name, date, id) tasks(id, type, date, status) Task: Retrieve id from sales whose type is found in tasks rows where status matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.status = sale.status );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08237
train
v2
Schema: staff (alias: empl)(amount, status, salary, code) invoices(type, date, amount, level) Task: Find id from staff where a matching record exists in invoices with the same status. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = empl.status );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08238
train
v3
Schema: items (alias: lne)(status, id, date, salary) requests(status, date, salary, level) Task: Retrieve amount from items with amount above the SUM(amount) of requests rows sharing the same code. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.code = lne.code );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_08239
train
v3
Schema: sales (alias: sale)(amount, type, id, salary) customers(status, value, type, code) Task: Retrieve name from sales with amount above the COUNT(amount) of customers rows sharing the same level. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08240
train
v3
Schema: transactions (alias: txn)(value, amount, name, salary) items(type, code, value, id) Task: Retrieve name from transactions with amount above the COUNT(amount) of items rows sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08241
train
v3
Schema: regions (alias: rgn)(name, code, value, amount) schedules(id, type, code, level) Task: Find name from regions where amount exceeds the count of amount from schedules for the same status. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08242
train
v1
Schema: regions (alias: rgn)(salary, level, status, type) projects(status, value, type, name) Task: Select value from regions where code exists in projects for the same code. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = rgn.code );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08243
train
v1
Schema: items (alias: lne)(amount, value, status, name) shipments(name, date, status, level) Task: Select name from items where status exists in shipments for the same id. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = lne.id );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_08244
train
v1
Schema: sales (alias: sale)(id, code, type, salary) categories(code, status, value, type) Task: Select code from sales where id exists in categories for the same status. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = sale.status );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08245
train
v1
Schema: transactions (alias: txn)(type, amount, level, value) regions(date, value, code, type) Task: Select amount from transactions where type exists in regions for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08246
train
v3
Schema: tasks (alias: tsk)(name, id, salary, level) departments(date, name, value, status) Task: Find code from tasks where value exceeds the minimum amount from departments for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_08247
train
v3
Schema: customers (alias: cust)(id, level, name, value) sales(amount, status, level, type) Task: Retrieve name from customers with salary above the AVG(amount) of sales rows sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.id = cust.id );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08248
train
v3
Schema: accounts (alias: acct)(type, date, salary, value) branches(value, date, type, id) Task: Find name from accounts where value exceeds the average salary from branches for the same status. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08249
train
v3
Schema: orders (alias: ord)(id, amount, type, value) sales(type, salary, id, status) Task: Find name from orders where value exceeds the minimum salary from sales for the same level. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.level = ord.level );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08250
train
v3
Schema: orders (alias: ord)(amount, id, date, level) tasks(type, name, amount, status) Task: Find amount from orders where value exceeds the maximum value from tasks for the same status. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08251
train
v3
Schema: schedules (alias: schd)(salary, status, name, level) employees(id, amount, date, salary) Task: Retrieve code from schedules with value above the SUM(amount) of employees rows sharing the same id. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08252
train
v1
Schema: sales (alias: sale)(status, value, id, date) customers(code, type, status, value) Task: Retrieve name from sales whose type is found in customers rows where level matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08253
train
v3
Schema: tasks (alias: tsk)(level, salary, type, id) branches(level, code, salary, id) Task: Retrieve value from tasks with value above the AVG(salary) of branches rows sharing the same status. SQL:
SELECT value FROM tasks AS tsk WHERE value > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_08254
train
v1
Schema: projects (alias: prj)(status, code, name, id) schedules(name, value, salary, status) Task: Find code from projects where code appears in schedules entries with matching level. SQL:
SELECT code FROM projects AS prj WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = prj.level );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08255
train
v1
Schema: accounts (alias: acct)(name, value, amount, status) tasks(name, type, status, code) Task: Find amount from accounts where status appears in tasks entries with matching level. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.level = acct.level );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08256
train
v3
Schema: tasks (alias: tsk)(date, amount, level, code) schedules(code, status, type, id) Task: Find code from tasks where amount exceeds the count of amount from schedules for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_08257
train
v1
Schema: regions (alias: rgn)(id, amount, value, level) projects(name, id, code, value) Task: Select name from regions where type exists in projects for the same code. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type 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": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08258
train
v3
Schema: customers (alias: cust)(type, date, id, code) accounts(id, code, amount, salary) Task: Retrieve id from customers with amount above the SUM(value) of accounts rows sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08259
train
v2
Schema: employees (alias: emp)(value, date, salary, amount) staff(date, salary, type, status) Task: Find amount from employees where a matching record exists in staff with the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = emp.id );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08260
train
v2
Schema: projects (alias: prj)(status, code, name, amount) products(salary, type, status, level) Task: Find code from projects where a matching record exists in products with the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = prj.level );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08261
train
v1
Schema: products (alias: prod)(level, id, type, status) tasks(code, id, status, salary) Task: Find amount from products where code appears in tasks entries with matching code. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.code = prod.code );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08262
train
v3
Schema: customers (alias: cust)(id, date, status, name) categories(value, level, id, name) Task: Retrieve name from customers with salary above the MIN(value) of categories rows sharing the same status. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT MIN(value) FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "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_08263
train
v2
Schema: categories (alias: catg)(name, id, level, amount) tasks(amount, id, status, value) Task: Find amount from categories where a matching record exists in tasks with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = catg.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08264
train
v1
Schema: managers (alias: mgr)(code, name, id, salary) departments(code, type, salary, status) Task: Select code from managers where id exists in departments for the same code. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08265
train
v1
Schema: schedules (alias: schd)(name, salary, date, code) transactions(name, status, amount, value) Task: Select name from schedules where status exists in transactions for the same id. SQL:
SELECT name 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": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08266
train
v3
Schema: managers (alias: mgr)(salary, status, level, type) accounts(salary, code, type, id) Task: Retrieve salary from managers with salary above the COUNT(value) of accounts rows sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08267
train
v3
Schema: sales (alias: sale)(amount, salary, id, name) shipments(level, status, date, salary) Task: Find code from sales where value exceeds the count of value from shipments for the same type. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08268
train
v1
Schema: categories (alias: catg)(status, date, amount, name) departments(id, name, value, code) Task: Find value from categories where status appears in departments entries with matching level. SQL:
SELECT value FROM categories AS catg WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08269
train
v3
Schema: products (alias: prod)(status, name, salary, date) items(date, type, name, status) Task: Retrieve amount from products with amount above the MAX(amount) of items rows sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.code = prod.code );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08270
train
v1
Schema: invoices (alias: inv)(value, salary, id, name) staff(amount, status, salary, code) Task: Select amount from invoices where code exists in staff for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08271
train
v3
Schema: projects (alias: prj)(date, level, value, name) branches(id, code, amount, level) Task: Retrieve code from projects with amount above the COUNT(amount) of branches rows sharing the same code. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.code = prj.code );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08272
train
v2
Schema: regions (alias: rgn)(salary, status, level, value) employees(level, salary, value, code) Task: Find salary from regions where a matching record exists in employees with the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08273
train
v3
Schema: categories (alias: catg)(salary, amount, id, type) employees(value, amount, status, type) Task: Find value from categories where value exceeds the minimum amount from employees for the same id. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08274
train
v1
Schema: categories (alias: catg)(name, code, status, id) managers(date, salary, code, status) Task: Select amount from categories where status exists in managers for the same code. SQL:
SELECT amount FROM categories AS catg WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = catg.code );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08275
train
v1
Schema: projects (alias: prj)(code, status, type, salary) requests(type, amount, salary, name) Task: Select name from projects where status exists in requests for the same code. SQL:
SELECT name FROM projects AS prj WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = prj.code );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08276
train
v1
Schema: categories (alias: catg)(type, amount, code, salary) transactions(level, status, salary, type) Task: Select salary from categories where code exists in transactions for the same level. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08277
train
v3
Schema: sales (alias: sale)(id, name, code, date) shipments(amount, salary, name, code) Task: Find value from sales where value exceeds the average amount from shipments for the same status. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08278
train
v3
Schema: regions (alias: rgn)(code, status, name, level) sales(name, id, value, status) Task: Retrieve amount from regions with salary above the COUNT(amount) of sales rows sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08279
train
v3
Schema: accounts (alias: acct)(date, value, id, status) staff(type, code, salary, id) Task: Retrieve id from accounts with salary above the SUM(amount) of staff rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.status = acct.status );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08280
train
v2
Schema: products (alias: prod)(id, type, date, amount) sales(type, name, salary, id) Task: Retrieve id from products that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08281
train
v2
Schema: employees (alias: emp)(name, level, id, value) projects(level, status, value, id) Task: Retrieve salary from employees that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = emp.id );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08282
train
v1
Schema: items (alias: lne)(id, name, date, type) tasks(status, amount, value, id) Task: Select salary from items where id exists in tasks for the same id. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = lne.id );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_08283
train
v3
Schema: orders (alias: ord)(type, name, level, status) accounts(id, status, type, code) Task: Retrieve code from orders with value above the AVG(salary) of accounts rows sharing the same status. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.status = ord.status );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08284
train
v1
Schema: categories (alias: catg)(name, level, status, value) shipments(type, name, date, salary) Task: Find name from categories where level appears in shipments entries with matching status. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08285
train
v3
Schema: shipments (alias: shp)(type, status, level, amount) invoices(id, name, value, salary) Task: Retrieve name from shipments with salary above the AVG(amount) of invoices rows sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08286
train
v2
Schema: accounts (alias: acct)(code, amount, id, date) requests(id, date, amount, status) Task: Retrieve id from accounts that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08287
train
v3
Schema: managers (alias: mgr)(value, salary, code, amount) requests(type, amount, date, code) Task: Retrieve value from managers with amount above the SUM(value) of requests rows sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08288
train
v1
Schema: products (alias: prod)(code, salary, amount, level) staff(salary, code, value, date) Task: Select amount from products where code exists in staff for the same level. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.level = prod.level );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08289
train
v2
Schema: transactions (alias: txn)(level, type, code, date) tasks(status, amount, name, level) Task: Retrieve id from transactions that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = txn.code );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08290
train
v1
Schema: categories (alias: catg)(amount, id, value, status) transactions(salary, status, type, id) Task: Select salary from categories where code exists in transactions for the same code. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08291
train
v2
Schema: regions (alias: rgn)(amount, code, salary, name) departments(level, value, amount, type) Task: Find code from regions where a matching record exists in departments with the same status. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = rgn.status );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08292
train
v1
Schema: employees (alias: emp)(value, salary, amount, code) sales(amount, value, salary, type) Task: Select value from employees where id exists in sales for the same type. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08293
train
v2
Schema: shipments (alias: shp)(amount, value, name, date) customers(code, amount, salary, type) Task: Find name from shipments where a matching record exists in customers with the same level. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08294
train
v1
Schema: projects (alias: prj)(status, amount, id, type) staff(status, salary, name, amount) Task: Find code from projects where status appears in staff entries with matching level. SQL:
SELECT code FROM projects AS prj WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = prj.level );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08295
train
v2
Schema: branches (alias: brc)(code, status, salary, date) regions(amount, code, value, id) Task: Find value from branches where a matching record exists in regions with the same level. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = brc.level );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08296
train
v1
Schema: transactions (alias: txn)(id, value, salary, name) schedules(value, date, amount, salary) Task: Retrieve name from transactions whose code is found in schedules rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08297
train
v1
Schema: customers (alias: cust)(name, status, salary, code) branches(amount, date, id, salary) Task: Find name from customers where code appears in branches entries with matching id. SQL:
SELECT name 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": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08298
train
v1
Schema: regions (alias: rgn)(value, type, id, status) accounts(level, date, id, name) Task: Find id from regions where status appears in accounts entries with matching id. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.id = rgn.id );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08299
train