variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: shipments (alias: shp)(salary, amount, name, value) schedules(type, amount, status, salary) Task: Find value from shipments where value exceeds the minimum value from schedules for the same id. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09400
train
v1
Schema: invoices (alias: inv)(name, value, type, salary) projects(status, value, level, type) Task: Retrieve id from invoices whose type is found in projects rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = inv.status );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09401
train
v3
Schema: transactions (alias: txn)(name, salary, status, value) branches(id, value, salary, type) Task: Retrieve salary from transactions with amount above the MAX(amount) of branches rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09402
train
v1
Schema: staff (alias: empl)(level, date, type, value) transactions(id, date, name, type) Task: Retrieve name from staff whose id is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = empl.code );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09403
train
v2
Schema: requests (alias: ordr)(type, salary, status, amount) transactions(date, name, value, level) Task: Find salary from requests where a matching record exists in transactions with the same code. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09404
train
v2
Schema: transactions (alias: txn)(salary, type, value, id) projects(type, value, status, code) Task: Find name from transactions where a matching record exists in projects with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09405
train
v2
Schema: tasks (alias: tsk)(amount, value, salary, code) transactions(name, level, id, type) Task: Retrieve salary from tasks that have at least one corresponding entry in transactions sharing 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_09406
train
v2
Schema: schedules (alias: schd)(name, status, id, type) managers(level, type, id, value) Task: Retrieve id from schedules that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09407
train
v1
Schema: shipments (alias: shp)(value, code, amount, salary) transactions(value, type, level, status) Task: Retrieve id from shipments whose level is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09408
train
v2
Schema: staff (alias: empl)(id, amount, salary, date) shipments(salary, code, amount, value) Task: Find id from staff where a matching record exists in shipments with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09409
train
v3
Schema: orders (alias: ord)(value, level, code, salary) shipments(value, amount, code, salary) Task: Retrieve value from orders with value above the COUNT(salary) of shipments rows sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09410
train
v3
Schema: transactions (alias: txn)(status, value, date, id) staff(name, value, id, salary) Task: Retrieve id from transactions with value above the SUM(amount) of staff rows sharing the same type. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09411
train
v1
Schema: sales (alias: sale)(name, value, status, salary) departments(amount, value, status, code) Task: Retrieve code from sales whose type is found in departments rows where status matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09412
train
v3
Schema: invoices (alias: inv)(amount, type, value, name) sales(name, type, salary, value) Task: Find value from invoices where salary exceeds the total amount from sales for the same code. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09413
train
v3
Schema: invoices (alias: inv)(code, level, status, date) products(salary, name, status, value) Task: Retrieve salary from invoices with salary above the COUNT(amount) of products rows sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.status = inv.status );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09414
train
v1
Schema: shipments (alias: shp)(amount, code, salary, date) transactions(code, amount, salary, level) Task: Select name from shipments where id exists in transactions for the same type. SQL:
SELECT name FROM shipments AS shp WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09415
train
v2
Schema: orders (alias: ord)(level, value, type, id) projects(code, amount, salary, name) Task: Find value from orders where a matching record exists in projects with the same code. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = ord.code );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "value", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09416
train
v1
Schema: regions (alias: rgn)(status, amount, value, type) categories(amount, value, status, salary) Task: Find amount from regions where status appears in categories entries with matching id. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09417
train
v2
Schema: products (alias: prod)(status, salary, amount, level) employees(value, salary, status, type) Task: Find salary from products where a matching record exists in employees with the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09418
train
v1
Schema: sales (alias: sale)(type, date, level, amount) transactions(value, level, id, salary) Task: Retrieve id from sales whose status is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09419
train
v2
Schema: employees (alias: emp)(status, amount, id, type) orders(type, code, salary, value) Task: Retrieve amount from employees that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09420
train
v1
Schema: departments (alias: dept)(type, code, amount, value) staff(salary, type, level, code) Task: Find value from departments where status appears in staff entries with matching id. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = dept.id );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09421
train
v1
Schema: managers (alias: mgr)(code, type, name, date) departments(salary, id, date, code) Task: Retrieve name from managers whose type is found in departments rows where level matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09422
train
v2
Schema: departments (alias: dept)(status, value, salary, id) items(id, amount, code, status) Task: Find value from departments where a matching record exists in items with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09423
train
v3
Schema: products (alias: prod)(type, value, name, salary) tasks(name, id, date, level) Task: Retrieve value from products with salary above the AVG(amount) of tasks rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.level = prod.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09424
train
v2
Schema: employees (alias: emp)(level, type, salary, code) managers(code, date, id, name) Task: Find salary from employees where a matching record exists in managers with the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09425
train
v3
Schema: tasks (alias: tsk)(status, code, value, id) regions(date, value, code, type) Task: Retrieve name from tasks with amount above the SUM(amount) of regions rows sharing the same id. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "name", "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_09426
train
v3
Schema: employees (alias: emp)(status, name, salary, amount) sales(type, level, id, date) Task: Retrieve amount from employees with amount above the COUNT(value) of sales rows sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = emp.code );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09427
train
v3
Schema: customers (alias: cust)(salary, code, id, amount) accounts(status, amount, salary, code) Task: Find code from customers where amount exceeds the minimum salary from accounts for the same type. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09428
train
v2
Schema: products (alias: prod)(name, status, level, amount) departments(salary, id, code, type) Task: Retrieve code from products that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09429
train
v1
Schema: sales (alias: sale)(level, type, salary, code) tasks(status, amount, code, name) Task: Select name from sales where type exists in tasks for the same code. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = sale.code );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09430
train
v2
Schema: schedules (alias: schd)(date, value, name, salary) transactions(value, level, type, date) Task: Retrieve id from schedules that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09431
train
v1
Schema: branches (alias: brc)(date, code, id, value) categories(level, id, date, status) Task: Retrieve code from branches whose level is found in categories rows where status matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = brc.status );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09432
train
v1
Schema: schedules (alias: schd)(salary, name, amount, value) orders(code, status, type, value) Task: Find name from schedules where status appears in orders entries with matching code. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = schd.code );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09433
train
v2
Schema: managers (alias: mgr)(salary, status, level, value) requests(code, value, salary, status) Task: Find value from managers where a matching record exists in requests with the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = mgr.id );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09434
train
v3
Schema: categories (alias: catg)(name, level, date, value) items(date, id, code, level) Task: Find code from categories where salary exceeds the minimum amount from items for the same id. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT MIN(amount) FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09435
train
v1
Schema: employees (alias: emp)(salary, type, amount, id) schedules(id, salary, value, code) Task: Select code from employees where level exists in schedules for the same code. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09436
train
v1
Schema: managers (alias: mgr)(level, code, type, salary) regions(code, id, date, status) Task: Select name from managers where level exists in regions for the same id. SQL:
SELECT name FROM managers AS mgr WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09437
train
v1
Schema: sales (alias: sale)(id, name, code, amount) staff(status, salary, level, name) Task: Retrieve code from sales whose level is found in staff rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09438
train
v2
Schema: schedules (alias: schd)(code, salary, id, name) regions(level, id, name, value) Task: Find salary from schedules where a matching record exists in regions with the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09439
train
v2
Schema: projects (alias: prj)(salary, date, value, type) shipments(salary, date, value, level) Task: Find amount from projects where a matching record exists in shipments with the same type. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = prj.type );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09440
train
v2
Schema: accounts (alias: acct)(date, salary, code, id) orders(level, date, id, amount) Task: Find amount from accounts where a matching record exists in orders with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09441
train
v3
Schema: staff (alias: empl)(amount, id, name, status) projects(level, date, status, type) Task: Find id from staff where amount exceeds the count of salary from projects for the same id. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.id = empl.id );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09442
train
v1
Schema: managers (alias: mgr)(salary, id, amount, name) orders(date, salary, id, code) Task: Find amount from managers where type appears in orders entries with matching type. SQL:
SELECT amount FROM managers AS mgr WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.type = mgr.type );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09443
train
v2
Schema: branches (alias: brc)(id, value, code, salary) invoices(name, salary, status, level) Task: Retrieve name from branches that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = brc.id );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09444
train
v3
Schema: schedules (alias: schd)(salary, value, status, type) requests(name, date, value, code) Task: Find value from schedules where value exceeds the average value from requests for the same id. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09445
train
v3
Schema: staff (alias: empl)(id, date, type, name) schedules(date, type, salary, level) Task: Find value from staff where amount exceeds the minimum salary from schedules for the same id. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.id = empl.id );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09446
train
v2
Schema: shipments (alias: shp)(level, id, date, amount) transactions(salary, status, value, code) Task: Find id from shipments where a matching record exists in transactions with the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09447
train
v1
Schema: managers (alias: mgr)(level, salary, amount, code) items(salary, value, date, name) Task: Retrieve amount from managers whose status is found in items rows where status matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09448
train
v2
Schema: invoices (alias: inv)(value, status, name, amount) sales(name, date, code, type) Task: Find value from invoices where a matching record exists in sales with the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = inv.id );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09449
train
v2
Schema: sales (alias: sale)(value, amount, code, id) accounts(level, salary, status, code) Task: Retrieve amount from sales that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09450
train
v1
Schema: tasks (alias: tsk)(level, type, name, salary) products(level, value, code, type) Task: Select value from tasks where code exists in products for the same code. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09451
train
v2
Schema: sales (alias: sale)(name, date, type, code) requests(date, amount, value, type) Task: Retrieve id from sales that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = sale.id );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09452
train
v1
Schema: products (alias: prod)(level, amount, salary, type) projects(level, type, name, date) Task: Select amount from products where type exists in projects for the same code. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.code = prod.code );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09453
train
v3
Schema: sales (alias: sale)(status, amount, code, id) categories(id, value, code, status) Task: Find id from sales where amount exceeds the maximum salary from categories for the same code. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.code = sale.code );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09454
train
v2
Schema: shipments (alias: shp)(date, level, code, type) projects(status, name, level, amount) Task: Find amount from shipments where a matching record exists in projects with the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = shp.status );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09455
train
v2
Schema: requests (alias: ordr)(amount, name, id, status) products(salary, code, status, type) Task: Retrieve id from requests that have at least one corresponding entry in products sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09456
train
v2
Schema: invoices (alias: inv)(amount, status, name, level) staff(date, salary, amount, value) Task: Find name from invoices where a matching record exists in staff with the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09457
train
v1
Schema: branches (alias: brc)(status, date, id, amount) invoices(id, level, type, salary) Task: Retrieve name from branches whose status is found in invoices rows where code matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = brc.code );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09458
train
v1
Schema: requests (alias: ordr)(type, status, value, salary) branches(value, salary, id, type) Task: Retrieve value from requests whose id is found in branches rows where type matches the outer record. 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_09459
train
v2
Schema: projects (alias: prj)(value, level, type, status) employees(level, status, amount, name) Task: Retrieve amount from projects that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = prj.level );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09460
train
v1
Schema: sales (alias: sale)(name, date, amount, id) products(date, value, salary, amount) Task: Find amount from sales where id appears in products entries with matching code. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = sale.code );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09461
train
v2
Schema: categories (alias: catg)(id, date, value, amount) managers(id, salary, code, amount) Task: Retrieve value from categories that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = catg.level );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09462
train
v3
Schema: customers (alias: cust)(type, name, level, salary) branches(status, salary, value, level) Task: Find salary from customers where amount exceeds the average amount from branches for the same status. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT AVG(amount) FROM branches AS brc WHERE brc.status = cust.status );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09463
train
v3
Schema: staff (alias: empl)(type, salary, level, code) branches(amount, date, id, status) Task: Retrieve salary from staff with salary above the SUM(salary) of branches rows sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09464
train
v2
Schema: customers (alias: cust)(code, amount, status, type) projects(value, name, type, amount) Task: Retrieve name from customers that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = cust.id );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09465
train
v3
Schema: customers (alias: cust)(value, status, type, code) managers(salary, id, date, amount) Task: Retrieve name from customers with amount above the SUM(value) of managers rows sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.code = cust.code );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09466
train
v3
Schema: staff (alias: empl)(status, value, date, amount) regions(level, status, salary, value) Task: Retrieve salary from staff with amount above the AVG(value) of regions rows sharing the same id. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09467
train
v3
Schema: items (alias: lne)(level, date, value, amount) accounts(value, name, date, type) Task: Find amount from items where value exceeds the average value from accounts for the same type. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09468
train
v3
Schema: staff (alias: empl)(level, amount, id, value) products(status, date, id, salary) Task: Retrieve amount from staff with value above the MAX(salary) of products rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09469
train
v3
Schema: categories (alias: catg)(level, type, date, status) customers(salary, name, date, type) Task: Find name from categories where salary exceeds the total amount from customers for the same code. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "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_09470
train
v1
Schema: tasks (alias: tsk)(amount, salary, value, type) employees(status, salary, id, amount) Task: Retrieve id from tasks whose status is found in employees rows where type matches the outer record. SQL:
SELECT id FROM tasks AS tsk WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09471
train
v2
Schema: categories (alias: catg)(value, status, level, code) employees(type, level, amount, value) Task: Retrieve value from categories that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09472
train
v3
Schema: tasks (alias: tsk)(date, value, status, id) employees(value, id, name, amount) Task: Retrieve name from tasks with salary above the COUNT(amount) of employees rows sharing the same status. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09473
train
v2
Schema: transactions (alias: txn)(date, salary, amount, code) branches(amount, value, name, code) Task: Retrieve amount from transactions that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "amount", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09474
train
v1
Schema: transactions (alias: txn)(date, type, salary, amount) categories(date, type, id, salary) Task: Retrieve code from transactions whose level is found in categories rows where status matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09475
train
v3
Schema: tasks (alias: tsk)(date, name, type, level) categories(date, code, status, salary) Task: Find amount from tasks where salary exceeds the maximum salary from categories for the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09476
train
v1
Schema: categories (alias: catg)(amount, salary, type, id) transactions(code, type, level, id) Task: Retrieve value from categories whose level is found in transactions rows where status matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09477
train
v3
Schema: products (alias: prod)(value, name, amount, code) shipments(value, amount, id, type) Task: Find code from products where value exceeds the average value from shipments for the same id. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09478
train
v1
Schema: categories (alias: catg)(name, salary, code, status) transactions(name, type, amount, level) Task: Select id from categories where status exists in transactions for the same id. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09479
train
v2
Schema: schedules (alias: schd)(code, name, type, level) employees(status, name, amount, salary) Task: Retrieve amount from schedules that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09480
train
v1
Schema: products (alias: prod)(status, id, level, name) managers(salary, date, level, status) Task: Select value from products where id exists in managers for the same type. SQL:
SELECT value FROM products AS prod WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09481
train
v3
Schema: sales (alias: sale)(value, date, code, level) categories(name, value, date, code) Task: Retrieve id from sales with value above the AVG(value) of categories rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.id = sale.id );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09482
train
v1
Schema: accounts (alias: acct)(level, name, type, date) customers(date, id, code, level) Task: Find id from accounts where code appears in customers entries with matching level. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = acct.level );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09483
train
v1
Schema: departments (alias: dept)(amount, name, code, status) schedules(value, status, code, level) Task: Find code from departments where level appears in schedules entries with matching code. SQL:
SELECT code FROM departments AS dept WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09484
train
v3
Schema: employees (alias: emp)(level, type, amount, name) sales(value, name, level, status) Task: Find salary from employees where salary exceeds the count of value from sales for the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.level = emp.level );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09485
train
v1
Schema: projects (alias: prj)(date, code, name, id) items(type, id, value, salary) Task: Find amount from projects where id appears in items entries with matching type. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = prj.type );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09486
train
v3
Schema: products (alias: prod)(status, amount, id, name) staff(id, date, level, salary) Task: Retrieve salary from products with amount above the SUM(amount) of staff rows sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09487
train
v1
Schema: staff (alias: empl)(code, level, value, status) invoices(code, salary, type, value) Task: Find code from staff where id appears in invoices entries with matching id. SQL:
SELECT code FROM staff AS empl WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.id = empl.id );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09488
train
v1
Schema: transactions (alias: txn)(status, id, date, level) categories(code, salary, value, name) Task: Find value from transactions where code appears in categories entries with matching status. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09489
train
v1
Schema: employees (alias: emp)(level, date, status, value) orders(id, status, value, name) Task: Find name from employees where id appears in orders entries with matching type. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09490
train
v3
Schema: staff (alias: empl)(code, date, level, type) regions(salary, name, amount, id) Task: Find id from staff where amount exceeds the average value from regions for the same type. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.type = empl.type );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09491
train
v3
Schema: staff (alias: empl)(type, amount, salary, status) requests(value, status, date, code) Task: Retrieve value from staff with salary above the AVG(value) of requests rows sharing the same status. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09492
train
v1
Schema: staff (alias: empl)(type, name, date, salary) schedules(level, value, id, salary) Task: Select name from staff where level exists in schedules for the same code. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09493
train
v2
Schema: shipments (alias: shp)(value, amount, code, name) requests(salary, status, name, code) Task: Retrieve salary from shipments that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09494
train
v1
Schema: items (alias: lne)(name, status, code, salary) tasks(salary, id, amount, value) Task: Select name from items where level exists in tasks for the same type. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.type = lne.type );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09495
train
v2
Schema: tasks (alias: tsk)(salary, date, type, code) sales(code, status, salary, level) Task: Retrieve id from tasks that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09496
train
v1
Schema: departments (alias: dept)(type, date, status, salary) accounts(amount, id, status, salary) Task: Retrieve code from departments whose status is found in accounts rows where code matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09497
train
v2
Schema: requests (alias: ordr)(amount, level, name, code) regions(salary, type, status, value) Task: Find name from requests where a matching record exists in regions with the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09498
train
v2
Schema: transactions (alias: txn)(level, salary, type, amount) projects(salary, level, name, id) Task: Retrieve name from transactions that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09499
train