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
v2
Schema: products (alias: prod)(amount, code, value, salary) branches(amount, type, status, code) Task: Find amount from products where a matching record exists in branches with the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = prod.id );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06400
train
v1
Schema: items (alias: lne)(id, level, type, salary) shipments(status, amount, type, date) Task: Retrieve id from items whose type is found in shipments rows where code matches the outer record. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = lne.code );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06401
train
v3
Schema: customers (alias: cust)(code, level, name, type) employees(date, amount, salary, value) Task: Find name from customers where value exceeds the total amount from employees for the same code. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.code = cust.code );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06402
train
v3
Schema: requests (alias: ordr)(type, date, code, value) staff(id, salary, amount, name) Task: Retrieve salary from requests with value above the SUM(value) of staff rows sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT SUM(value) FROM staff AS empl WHERE empl.id = ordr.id );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06403
train
v1
Schema: departments (alias: dept)(date, name, salary, amount) sales(name, value, level, salary) Task: Select name from departments where level exists in sales for the same level. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06404
train
v2
Schema: requests (alias: ordr)(amount, value, code, date) accounts(amount, value, name, status) Task: Find amount from requests where a matching record exists in accounts with the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06405
train
v2
Schema: staff (alias: empl)(type, level, date, id) schedules(value, salary, amount, type) Task: Find salary from staff where a matching record exists in schedules with the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06406
train
v2
Schema: branches (alias: brc)(status, type, id, date) departments(date, name, type, amount) Task: Find amount from branches where a matching record exists in departments with the same level. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = brc.level );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06407
train
v3
Schema: regions (alias: rgn)(value, code, date, name) transactions(id, level, status, amount) Task: Find name from regions where salary exceeds the minimum value from transactions for the same status. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06408
train
v3
Schema: staff (alias: empl)(salary, value, date, name) transactions(id, salary, status, type) Task: Find name from staff where salary exceeds the maximum salary from transactions for the same level. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06409
train
v2
Schema: tasks (alias: tsk)(date, salary, type, level) regions(id, value, code, amount) Task: Find name from tasks where a matching record exists in regions with the same code. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06410
train
v2
Schema: products (alias: prod)(code, salary, id, status) categories(code, salary, date, level) Task: Retrieve value from products that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06411
train
v1
Schema: staff (alias: empl)(amount, date, level, name) shipments(type, value, amount, name) Task: Select salary from staff where id exists in shipments for the same id. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = empl.id );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06412
train
v1
Schema: staff (alias: empl)(level, code, status, type) orders(status, type, code, id) Task: Retrieve amount from staff whose type is found in orders rows where code matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06413
train
v3
Schema: accounts (alias: acct)(code, name, amount, value) sales(value, date, id, name) Task: Retrieve code from accounts with salary above the SUM(amount) of sales rows sharing the same status. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "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_06414
train
v1
Schema: regions (alias: rgn)(salary, date, level, name) tasks(name, value, type, amount) Task: Select amount from regions where status exists in tasks for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.id = rgn.id );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06415
train
v1
Schema: tasks (alias: tsk)(date, amount, salary, value) schedules(type, value, date, code) Task: Retrieve name from tasks whose level is found in schedules rows where status matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06416
train
v1
Schema: orders (alias: ord)(name, status, value, salary) schedules(status, date, code, value) Task: Select amount from orders where level exists in schedules for the same code. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06417
train
v3
Schema: categories (alias: catg)(name, amount, id, status) transactions(id, type, status, level) Task: Find code from categories where salary exceeds the total amount from transactions for the same code. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06418
train
v1
Schema: customers (alias: cust)(salary, code, amount, value) items(id, name, code, date) Task: Find id from customers where type appears in items entries with matching level. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = cust.level );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06419
train
v2
Schema: tasks (alias: tsk)(type, name, value, amount) projects(salary, level, type, status) Task: Retrieve salary from tasks that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "salary", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06420
train
v1
Schema: requests (alias: ordr)(id, type, status, salary) branches(amount, name, date, id) Task: Find value from requests where id appears in branches entries with matching type. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06421
train
v2
Schema: items (alias: lne)(value, salary, type, id) transactions(amount, name, salary, code) Task: Retrieve name from items that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06422
train
v3
Schema: shipments (alias: shp)(level, type, amount, date) orders(code, name, salary, id) Task: Retrieve amount from shipments with value above the MIN(salary) of orders rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.code = shp.code );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06423
train
v1
Schema: items (alias: lne)(code, type, amount, status) regions(date, code, salary, type) Task: Select name from items where type exists in regions for the same level. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06424
train
v3
Schema: transactions (alias: txn)(level, status, name, date) employees(date, name, type, salary) Task: Retrieve name from transactions with value above the COUNT(value) of employees rows sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06425
train
v2
Schema: managers (alias: mgr)(amount, value, salary, level) staff(level, name, status, date) Task: Find name from managers where a matching record exists in staff with the same id. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06426
train
v3
Schema: shipments (alias: shp)(status, id, amount, level) invoices(id, level, value, salary) Task: Retrieve amount from shipments with value above the COUNT(amount) of invoices rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06427
train
v1
Schema: customers (alias: cust)(salary, date, value, name) shipments(salary, type, value, date) Task: Retrieve amount from customers whose type is found in shipments rows where type matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.type = cust.type );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06428
train
v2
Schema: categories (alias: catg)(name, salary, status, amount) customers(name, level, status, date) Task: Find salary from categories where a matching record exists in customers with the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06429
train
v1
Schema: regions (alias: rgn)(date, code, salary, level) transactions(name, id, salary, type) Task: Select name from regions where type exists in transactions for the same status. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06430
train
v3
Schema: branches (alias: brc)(id, salary, value, amount) shipments(type, id, status, value) Task: Retrieve value from branches with salary above the AVG(salary) of shipments rows sharing the same type. SQL:
SELECT value FROM branches AS brc WHERE salary > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.type = brc.type );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06431
train
v3
Schema: departments (alias: dept)(date, name, value, level) accounts(code, date, type, amount) Task: Retrieve amount from departments with amount above the AVG(amount) of accounts rows sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.status = dept.status );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06432
train
v1
Schema: schedules (alias: schd)(salary, code, status, name) branches(value, salary, amount, id) Task: Find name from schedules where id appears in branches entries with matching status. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = schd.status );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06433
train
v3
Schema: regions (alias: rgn)(amount, status, code, id) shipments(type, id, code, date) Task: Retrieve name from regions with value above the MAX(amount) of shipments rows sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06434
train
v2
Schema: managers (alias: mgr)(status, name, type, amount) customers(date, code, status, type) Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06435
train
v1
Schema: categories (alias: catg)(name, type, value, level) schedules(status, salary, code, type) Task: Find id from categories where id appears in schedules entries with matching level. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06436
train
v3
Schema: items (alias: lne)(salary, id, value, status) accounts(code, type, name, date) Task: Find code from items where amount exceeds the minimum salary from accounts for the same status. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.status = lne.status );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06437
train
v2
Schema: shipments (alias: shp)(type, level, date, amount) projects(code, amount, date, id) Task: Find salary from shipments where a matching record exists in projects with the same id. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = shp.id );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "salary", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06438
train
v3
Schema: accounts (alias: acct)(id, name, salary, code) schedules(salary, name, value, id) Task: Find value from accounts where salary exceeds the average salary from schedules for the same id. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06439
train
v1
Schema: regions (alias: rgn)(amount, salary, level, type) projects(id, amount, status, name) Task: Find id from regions where id appears in projects entries with matching code. SQL:
SELECT id FROM regions AS rgn WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = rgn.code );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06440
train
v3
Schema: sales (alias: sale)(type, amount, date, id) branches(type, amount, level, date) Task: Retrieve code from sales with salary above the SUM(amount) of branches rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.type = sale.type );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06441
train
v3
Schema: requests (alias: ordr)(name, type, date, amount) orders(salary, code, type, name) Task: Retrieve value from requests with salary above the COUNT(value) of orders rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06442
train
v1
Schema: accounts (alias: acct)(name, status, date, code) sales(date, code, name, value) Task: Retrieve salary from accounts whose code is found in sales rows where id matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = acct.id );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06443
train
v1
Schema: accounts (alias: acct)(id, type, level, code) orders(id, date, salary, value) Task: Select id from accounts where code exists in orders for the same level. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06444
train
v1
Schema: regions (alias: rgn)(status, level, name, code) shipments(status, code, level, amount) Task: Retrieve salary from regions whose id is found in shipments rows where code matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06445
train
v3
Schema: transactions (alias: txn)(type, code, level, salary) employees(name, value, id, code) Task: Find id from transactions where salary exceeds the maximum value from employees for the same status. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06446
train
v1
Schema: products (alias: prod)(status, date, salary, amount) accounts(id, level, value, type) Task: Select amount from products where type exists in accounts for the same id. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06447
train
v2
Schema: departments (alias: dept)(level, salary, type, amount) accounts(id, name, level, value) Task: Find id from departments where a matching record exists in accounts with 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_06448
train
v2
Schema: orders (alias: ord)(value, date, type, status) staff(type, level, date, code) Task: Find salary from orders where a matching record exists in staff with the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = ord.id );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06449
train
v1
Schema: managers (alias: mgr)(type, date, level, code) tasks(id, amount, name, value) Task: Find code from managers where level appears in tasks entries with matching type. SQL:
SELECT code FROM managers AS mgr WHERE level IN ( SELECT level 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": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06450
train
v2
Schema: categories (alias: catg)(code, id, date, level) staff(name, type, status, amount) Task: Find name from categories where a matching record exists in staff with the same id. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = catg.id );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06451
train
v2
Schema: items (alias: lne)(date, id, amount, code) regions(value, name, code, salary) Task: Retrieve id from items that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06452
train
v1
Schema: employees (alias: emp)(salary, type, code, amount) customers(code, id, level, status) Task: Find name from employees where id appears in customers entries with matching status. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06453
train
v2
Schema: regions (alias: rgn)(salary, name, type, date) accounts(id, amount, date, value) Task: Retrieve name from regions that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06454
train
v3
Schema: regions (alias: rgn)(type, amount, date, status) tasks(value, status, type, name) Task: Find code from regions where salary exceeds the average salary from tasks for the same level. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.level = rgn.level );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06455
train
v3
Schema: sales (alias: sale)(status, level, code, id) employees(name, type, id, status) Task: Find id from sales where amount exceeds the count of value from employees for the same status. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.status = sale.status );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06456
train
v2
Schema: schedules (alias: schd)(status, name, id, level) categories(date, salary, level, value) Task: Retrieve id from schedules that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06457
train
v3
Schema: products (alias: prod)(code, status, type, id) sales(status, salary, amount, type) Task: Retrieve code from products with value above the SUM(amount) of sales rows sharing the same id. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06458
train
v1
Schema: categories (alias: catg)(date, amount, type, salary) accounts(value, status, name, code) Task: Select id from categories where level exists in accounts for the same id. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06459
train
v1
Schema: requests (alias: ordr)(id, level, name, amount) orders(date, level, salary, name) Task: Select code from requests where status exists in orders for the same level. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06460
train
v2
Schema: tasks (alias: tsk)(amount, date, level, code) orders(name, code, date, status) Task: Find amount from tasks where a matching record exists in orders with the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06461
train
v2
Schema: accounts (alias: acct)(id, code, name, type) branches(code, salary, date, level) Task: Find code from accounts where a matching record exists in branches with the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06462
train
v2
Schema: departments (alias: dept)(status, value, date, level) projects(level, name, id, date) Task: Find value from departments where a matching record exists in projects with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = dept.code );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06463
train
v2
Schema: categories (alias: catg)(type, value, id, amount) managers(date, status, level, type) Task: Find salary from categories where a matching record exists in managers with the same code. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = catg.code );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06464
train
v1
Schema: projects (alias: prj)(level, type, amount, id) regions(id, name, code, type) Task: Find code from projects where status appears in regions entries with matching type. SQL:
SELECT code FROM projects AS prj WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = prj.type );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06465
train
v3
Schema: departments (alias: dept)(amount, type, status, code) managers(value, amount, date, code) Task: Find name from departments where amount exceeds the minimum salary from managers for the same code. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06466
train
v3
Schema: shipments (alias: shp)(type, amount, status, value) managers(salary, id, date, name) Task: Find code from shipments where amount exceeds the total value from managers for the same level. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06467
train
v1
Schema: managers (alias: mgr)(type, value, code, date) transactions(name, id, date, amount) Task: Find salary from managers where level appears in transactions entries with matching status. SQL:
SELECT salary FROM managers AS mgr WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06468
train
v1
Schema: requests (alias: ordr)(value, amount, level, date) customers(salary, type, date, value) Task: Find value from requests where level appears in customers entries with matching id. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06469
train
v2
Schema: managers (alias: mgr)(id, code, salary, type) branches(value, status, date, id) Task: Retrieve id from managers that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = mgr.level );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06470
train
v1
Schema: customers (alias: cust)(value, status, level, type) staff(id, salary, name, code) Task: Find salary from customers where type appears in staff entries with matching type. SQL:
SELECT salary FROM customers AS cust WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06471
train
v1
Schema: staff (alias: empl)(name, date, level, id) managers(code, date, value, id) Task: Retrieve amount from staff whose status is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06472
train
v1
Schema: items (alias: lne)(amount, status, id, name) requests(salary, id, amount, level) Task: Find value from items where level appears in requests entries with matching status. SQL:
SELECT value FROM items AS lne WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06473
train
v1
Schema: departments (alias: dept)(value, level, id, salary) projects(level, value, status, name) Task: Retrieve amount from departments whose level is found in projects rows where status matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.status = dept.status );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06474
train
v1
Schema: sales (alias: sale)(date, level, amount, name) employees(level, value, status, salary) Task: Retrieve salary from sales whose code is found in employees rows where status matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = sale.status );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06475
train
v3
Schema: managers (alias: mgr)(amount, value, date, level) tasks(id, type, salary, status) Task: Retrieve name from managers with amount above the AVG(amount) of tasks rows sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.level = mgr.level );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06476
train
v1
Schema: sales (alias: sale)(salary, level, value, id) regions(level, id, type, status) Task: Retrieve code from sales whose status is found in regions rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = sale.code );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06477
train
v1
Schema: invoices (alias: inv)(salary, level, id, amount) requests(value, amount, code, name) Task: Retrieve id from invoices whose type is found in requests rows where type matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06478
train
v3
Schema: projects (alias: prj)(level, value, amount, type) schedules(salary, id, status, type) Task: Find salary from projects where salary exceeds the maximum salary from schedules for the same status. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.status = prj.status );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06479
train
v3
Schema: invoices (alias: inv)(value, date, level, type) items(date, type, value, name) Task: Retrieve code from invoices with salary above the MIN(salary) of items rows sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06480
train
v3
Schema: schedules (alias: schd)(value, level, date, salary) invoices(date, id, value, level) Task: Find id from schedules where amount exceeds the total value from invoices for the same status. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06481
train
v2
Schema: tasks (alias: tsk)(salary, name, type, status) schedules(value, id, status, date) Task: Retrieve code from tasks that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06482
train
v1
Schema: accounts (alias: acct)(status, name, amount, salary) categories(id, code, name, salary) Task: Select name from accounts where type exists in categories for the same code. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.code = acct.code );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06483
train
v3
Schema: shipments (alias: shp)(level, value, date, status) schedules(value, amount, date, level) Task: Find name from shipments where amount exceeds the maximum amount from schedules for the same status. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06484
train
v2
Schema: tasks (alias: tsk)(salary, name, date, value) transactions(value, type, salary, name) Task: Find salary from tasks where a matching record exists in transactions with the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06485
train
v3
Schema: invoices (alias: inv)(level, code, name, type) sales(code, status, value, id) Task: Find name from invoices where value exceeds the count of value from sales for the same id. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.id = inv.id );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06486
train
v1
Schema: departments (alias: dept)(amount, value, status, date) products(salary, name, value, code) Task: Find code from departments where status appears in products entries with matching type. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06487
train
v2
Schema: managers (alias: mgr)(status, id, salary, amount) shipments(status, type, id, level) Task: Retrieve id from managers that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06488
train
v3
Schema: tasks (alias: tsk)(id, amount, code, value) categories(status, salary, code, id) Task: Find code from tasks where amount exceeds the count of salary from categories for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06489
train
v1
Schema: tasks (alias: tsk)(amount, name, type, id) projects(value, id, salary, name) Task: Retrieve salary from tasks whose type is found in projects rows where status matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06490
train
v2
Schema: items (alias: lne)(value, code, id, status) branches(value, name, date, amount) Task: Retrieve code from items that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = lne.id );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06491
train
v3
Schema: branches (alias: brc)(type, salary, code, id) shipments(amount, level, id, status) Task: Retrieve code from branches with amount above the MAX(salary) of shipments rows sharing the same id. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.id = brc.id );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06492
train
v1
Schema: orders (alias: ord)(id, date, status, amount) transactions(name, type, amount, salary) Task: Select code from orders where code exists in transactions for the same level. SQL:
SELECT code FROM orders AS ord WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = ord.level );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06493
train
v1
Schema: items (alias: lne)(salary, code, value, status) regions(name, date, id, status) Task: Find salary from items where code appears in regions entries with matching status. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06494
train
v3
Schema: projects (alias: prj)(salary, level, date, id) departments(id, type, code, salary) Task: Find name from projects where amount exceeds the average value from departments for the same level. SQL:
SELECT name FROM projects AS prj WHERE amount > ( SELECT AVG(value) FROM departments AS dept WHERE dept.level = prj.level );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06495
train
v2
Schema: branches (alias: brc)(id, code, type, salary) accounts(amount, name, status, value) Task: Retrieve amount from branches that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = brc.type );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06496
train
v2
Schema: orders (alias: ord)(level, amount, date, salary) customers(date, type, amount, value) Task: Find code from orders where a matching record exists in customers with the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = ord.code );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06497
train
v1
Schema: products (alias: prod)(level, code, type, status) staff(salary, code, id, value) Task: Retrieve amount from products whose id is found in staff rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06498
train
v1
Schema: branches (alias: brc)(salary, date, level, id) categories(salary, level, amount, date) Task: Find id from branches where code appears in categories entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = brc.code );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06499
train