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: managers (alias: mgr)(status, amount, date, code) staff(salary, level, date, value) Task: Retrieve code from managers with amount above the SUM(amount) of staff rows sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18400
train
v2
Schema: projects (alias: prj)(status, salary, type, name) orders(level, id, status, code) Task: Find name from projects where a matching record exists in orders with the same status. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = prj.status );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18401
train
v3
Schema: customers (alias: cust)(name, type, level, id) requests(type, id, code, salary) Task: Find salary from customers where amount exceeds the maximum value from requests for the same type. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18402
train
v1
Schema: sales (alias: sale)(status, salary, code, id) branches(value, status, id, salary) Task: Select id from sales where status exists in branches for the same level. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = sale.level );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18403
train
v3
Schema: departments (alias: dept)(name, code, value, status) orders(level, type, name, id) Task: Retrieve name from departments with value above the MIN(amount) of orders rows sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18404
train
v2
Schema: transactions (alias: txn)(date, level, type, amount) products(name, status, date, type) Task: Find name from transactions where a matching record exists in products with the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18405
train
v2
Schema: staff (alias: empl)(amount, salary, type, id) items(code, name, status, level) Task: Find salary from staff where a matching record exists in items with the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18406
train
v2
Schema: sales (alias: sale)(status, value, level, code) schedules(value, type, code, salary) Task: Find name from sales where a matching record exists in schedules with the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18407
train
v3
Schema: sales (alias: sale)(code, value, level, salary) requests(status, salary, code, value) Task: Find value from sales where salary exceeds the average value from requests for the same level. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18408
train
v3
Schema: departments (alias: dept)(type, salary, date, id) projects(amount, level, id, date) Task: Retrieve name from departments with value above the SUM(value) of projects rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT SUM(value) FROM projects AS prj WHERE prj.id = dept.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18409
train
v1
Schema: invoices (alias: inv)(amount, value, type, salary) tasks(date, id, amount, status) Task: Select amount from invoices where level exists in tasks for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = inv.code );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18410
train
v3
Schema: sales (alias: sale)(level, type, code, name) categories(type, status, code, amount) Task: Retrieve salary from sales with salary above the MIN(salary) of categories rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.status = sale.status );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18411
train
v1
Schema: requests (alias: ordr)(level, status, salary, value) invoices(type, amount, level, code) Task: Retrieve code from requests whose level is found in invoices rows where level matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18412
train
v1
Schema: shipments (alias: shp)(level, type, value, code) requests(status, code, value, date) Task: Select code from shipments where level exists in requests for the same level. SQL:
SELECT code FROM shipments AS shp WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18413
train
v3
Schema: items (alias: lne)(amount, id, name, level) products(code, amount, name, date) Task: Find id from items where value exceeds the total amount from products for the same type. SQL:
SELECT id FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18414
train
v1
Schema: employees (alias: emp)(level, salary, type, name) items(type, id, date, salary) Task: Find value from employees where status appears in items entries with matching type. SQL:
SELECT value FROM employees AS emp WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18415
train
v2
Schema: products (alias: prod)(date, salary, level, amount) shipments(date, value, status, name) Task: Find amount from products where a matching record exists in shipments with the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18416
train
v2
Schema: transactions (alias: txn)(salary, name, value, type) categories(code, id, amount, level) Task: Retrieve value from transactions that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18417
train
v3
Schema: schedules (alias: schd)(id, salary, date, status) customers(id, date, status, name) Task: Find id from schedules where amount exceeds the minimum salary from customers for the same type. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18418
train
v3
Schema: products (alias: prod)(code, value, amount, type) employees(amount, salary, name, status) Task: Find code from products where value exceeds the total salary from employees for the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18419
train
v1
Schema: accounts (alias: acct)(amount, status, type, name) shipments(level, amount, salary, type) Task: Retrieve name from accounts whose type is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18420
train
v2
Schema: products (alias: prod)(amount, name, type, code) staff(date, id, amount, type) Task: Retrieve amount from products that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18421
train
v3
Schema: transactions (alias: txn)(type, id, value, salary) items(amount, salary, value, level) Task: Find name from transactions where amount exceeds the maximum amount from items for the same level. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18422
train
v1
Schema: sales (alias: sale)(status, name, code, amount) accounts(name, status, level, salary) Task: Find id from sales where id appears in accounts entries with matching status. SQL:
SELECT id FROM sales AS sale WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18423
train
v1
Schema: departments (alias: dept)(type, amount, id, code) requests(id, type, code, amount) Task: Find salary from departments where status appears in requests entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18424
train
v1
Schema: departments (alias: dept)(date, status, value, level) schedules(name, level, type, amount) Task: Select value from departments where status exists in schedules for the same code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18425
train
v2
Schema: managers (alias: mgr)(level, id, status, amount) schedules(date, name, level, salary) Task: Retrieve salary from managers that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = mgr.level );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18426
train
v1
Schema: transactions (alias: txn)(id, code, type, date) employees(name, status, code, id) Task: Retrieve amount from transactions whose type is found in employees rows where level matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18427
train
v2
Schema: tasks (alias: tsk)(level, status, code, value) items(type, id, date, name) Task: Find name from tasks where a matching record exists in items with the same code. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "name", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18428
train
v2
Schema: projects (alias: prj)(level, status, date, name) shipments(code, date, salary, amount) Task: Find id from projects where a matching record exists in shipments with the same status. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = prj.status );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18429
train
v1
Schema: tasks (alias: tsk)(id, status, amount, type) shipments(code, name, date, status) Task: Select amount from tasks where status exists in shipments for the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18430
train
v1
Schema: staff (alias: empl)(level, type, id, date) branches(name, amount, level, status) Task: Find value from staff where id appears in branches entries with matching level. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.level = empl.level );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18431
train
v2
Schema: staff (alias: empl)(level, date, code, id) requests(status, level, id, code) Task: Find amount from staff where a matching record exists in requests with the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18432
train
v2
Schema: shipments (alias: shp)(date, salary, name, type) tasks(value, date, amount, type) Task: Find salary from shipments where a matching record exists in tasks with the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = shp.level );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18433
train
v3
Schema: categories (alias: catg)(value, type, status, amount) items(name, id, amount, date) Task: Find id from categories where amount exceeds the average salary from items for the same level. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18434
train
v3
Schema: departments (alias: dept)(salary, level, code, name) regions(date, name, code, id) Task: Find value from departments where salary exceeds the total salary from regions for the same code. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.code = dept.code );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18435
train
v1
Schema: projects (alias: prj)(level, amount, status, type) transactions(amount, value, date, name) Task: Retrieve salary from projects whose code is found in transactions rows where level matches the outer record. SQL:
SELECT salary FROM projects AS prj WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18436
train
v1
Schema: shipments (alias: shp)(status, amount, value, salary) schedules(salary, code, id, type) Task: Find id from shipments where type appears in schedules entries with matching code. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = shp.code );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18437
train
v1
Schema: orders (alias: ord)(salary, code, value, name) projects(status, value, amount, code) Task: Select id from orders where code exists in projects for the same code. SQL:
SELECT id FROM orders AS ord WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = ord.code );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18438
train
v2
Schema: accounts (alias: acct)(code, name, level, date) categories(name, date, id, level) Task: Retrieve name from accounts that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18439
train
v3
Schema: transactions (alias: txn)(level, amount, type, code) projects(date, salary, status, amount) Task: Retrieve amount from transactions with value above the COUNT(salary) of projects rows sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18440
train
v2
Schema: tasks (alias: tsk)(code, status, name, date) departments(name, status, level, id) Task: Find name from tasks where a matching record exists in departments with the same id. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18441
train
v1
Schema: products (alias: prod)(date, type, status, id) departments(status, salary, name, value) Task: Retrieve id from products whose status is found in departments rows where type matches the outer record. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = prod.type );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18442
train
v1
Schema: products (alias: prod)(salary, id, value, name) requests(status, date, type, level) Task: Select code from products where code exists in requests for the same id. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = prod.id );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18443
train
v3
Schema: invoices (alias: inv)(salary, code, status, date) requests(value, name, status, amount) Task: Find name from invoices where amount exceeds the count of amount from requests for the same level. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18444
train
v2
Schema: transactions (alias: txn)(date, name, id, status) regions(salary, status, type, date) Task: Find amount from transactions where a matching record exists in regions with the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18445
train
v3
Schema: requests (alias: ordr)(status, type, salary, date) tasks(status, salary, id, level) Task: Retrieve code from requests with salary above the MAX(value) of tasks rows sharing the same level. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.level = ordr.level );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18446
train
v3
Schema: items (alias: lne)(status, date, id, level) orders(date, code, status, salary) Task: Find id from items where amount exceeds the minimum salary from orders for the same level. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.level = lne.level );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18447
train
v1
Schema: transactions (alias: txn)(date, value, status, level) projects(name, value, date, amount) Task: Select name from transactions where status exists in projects for the same status. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18448
train
v3
Schema: managers (alias: mgr)(type, date, code, id) regions(code, type, salary, status) Task: Find id from managers where salary exceeds the average amount from regions for the same status. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18449
train
v1
Schema: requests (alias: ordr)(level, salary, value, code) invoices(id, type, salary, status) Task: Select amount from requests where level exists in invoices for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18450
train
v2
Schema: accounts (alias: acct)(code, type, level, name) requests(level, name, code, value) Task: Find code from accounts where a matching record exists in requests with the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18451
train
v3
Schema: invoices (alias: inv)(value, status, type, name) branches(code, value, amount, type) Task: Retrieve id from invoices with amount above the SUM(amount) of branches rows sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.status = inv.status );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18452
train
v1
Schema: customers (alias: cust)(date, name, value, status) staff(id, salary, name, level) Task: Select value from customers where type exists in staff for the same level. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = cust.level );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18453
train
v2
Schema: branches (alias: brc)(date, value, salary, name) accounts(date, amount, status, code) Task: Retrieve code from branches that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = brc.status );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18454
train
v1
Schema: staff (alias: empl)(amount, value, date, status) products(date, salary, value, name) Task: Select id from staff where level exists in products for the same code. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = empl.code );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18455
train
v2
Schema: requests (alias: ordr)(name, value, code, level) categories(date, name, level, amount) Task: Find name from requests where a matching record exists in categories with the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18456
train
v1
Schema: requests (alias: ordr)(date, level, code, value) staff(date, code, level, value) Task: Retrieve amount from requests whose id is found in staff rows where level matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = ordr.level );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18457
train
v3
Schema: sales (alias: sale)(salary, code, type, amount) orders(status, amount, salary, date) Task: Retrieve code from sales with value above the MAX(salary) of orders rows sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18458
train
v2
Schema: employees (alias: emp)(status, salary, level, type) managers(level, type, status, amount) Task: Find code from employees where a matching record exists in managers with the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18459
train
v2
Schema: managers (alias: mgr)(value, code, type, level) accounts(salary, type, name, status) Task: Find value from managers where a matching record exists in accounts with the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18460
train
v3
Schema: requests (alias: ordr)(name, value, id, code) orders(date, salary, id, name) Task: Find code from requests where value exceeds the minimum value from orders for the same status. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MIN(value) FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18461
train
v1
Schema: orders (alias: ord)(code, amount, status, date) departments(id, value, level, code) Task: Retrieve name from orders whose code is found in departments rows where status matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18462
train
v3
Schema: sales (alias: sale)(date, type, id, value) projects(status, salary, id, name) Task: Retrieve value from sales with value above the MIN(value) of projects rows sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT MIN(value) FROM projects AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18463
train
v3
Schema: schedules (alias: schd)(code, amount, name, value) projects(value, name, level, type) Task: Retrieve salary from schedules with amount above the MIN(salary) of projects rows sharing the same status. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.status = schd.status );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18464
train
v3
Schema: invoices (alias: inv)(amount, salary, name, level) staff(type, code, id, level) Task: Find salary from invoices where value exceeds the average value from staff for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18465
train
v2
Schema: invoices (alias: inv)(salary, date, level, value) staff(name, type, date, id) Task: Retrieve name from invoices that have at least one corresponding entry in staff sharing 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_18466
train
v2
Schema: sales (alias: sale)(code, value, date, salary) employees(value, type, amount, date) Task: Find amount from sales where a matching record exists in employees with the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18467
train
v1
Schema: orders (alias: ord)(id, type, status, amount) accounts(level, type, salary, date) Task: Retrieve salary from orders whose type is found in accounts rows where code matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18468
train
v2
Schema: shipments (alias: shp)(level, value, salary, code) transactions(amount, date, value, id) Task: Retrieve code from shipments that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18469
train
v2
Schema: employees (alias: emp)(date, salary, name, level) shipments(salary, type, status, id) Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18470
train
v1
Schema: tasks (alias: tsk)(value, date, type, level) products(amount, value, salary, type) Task: Retrieve amount from tasks whose code is found in products rows where type matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18471
train
v1
Schema: customers (alias: cust)(id, status, code, salary) invoices(type, id, amount, level) Task: Retrieve name from customers whose code is found in invoices rows where id matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18472
train
v1
Schema: regions (alias: rgn)(code, name, type, amount) employees(name, id, amount, date) Task: Find code from regions where type appears in employees entries with matching code. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18473
train
v3
Schema: departments (alias: dept)(value, date, name, level) projects(level, type, amount, date) Task: Find code from departments where salary exceeds the total amount from projects for the same type. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18474
train
v1
Schema: tasks (alias: tsk)(value, id, salary, name) items(level, code, date, id) Task: Find value from tasks where code appears in items entries with matching status. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18475
train
v2
Schema: customers (alias: cust)(date, name, amount, status) managers(id, date, amount, level) Task: Retrieve amount from customers that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18476
train
v2
Schema: managers (alias: mgr)(code, amount, id, status) tasks(type, status, date, value) Task: Find value from managers where a matching record exists in tasks with the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = mgr.type );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18477
train
v2
Schema: sales (alias: sale)(code, level, value, date) accounts(salary, type, value, amount) Task: Find name from sales where a matching record exists in accounts with the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18478
train
v3
Schema: categories (alias: catg)(status, code, id, type) accounts(value, type, level, name) Task: Find name from categories where value exceeds the count of amount from accounts for the same level. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18479
train
v2
Schema: sales (alias: sale)(level, salary, date, code) accounts(amount, level, salary, code) Task: Retrieve id from sales that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18480
train
v2
Schema: requests (alias: ordr)(type, value, code, amount) staff(salary, status, date, value) Task: Retrieve code from requests that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = ordr.level );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18481
train
v2
Schema: departments (alias: dept)(level, name, code, type) items(id, level, amount, date) Task: Retrieve salary from departments that have at least one corresponding entry in items sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18482
train
v2
Schema: customers (alias: cust)(value, status, id, level) tasks(amount, salary, name, type) Task: Retrieve amount from customers that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = cust.status );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18483
train
v1
Schema: customers (alias: cust)(status, amount, date, type) orders(level, value, amount, type) Task: Select amount from customers where status exists in orders for the same code. SQL:
SELECT amount FROM customers AS cust WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18484
train
v1
Schema: schedules (alias: schd)(code, value, amount, id) items(value, amount, id, level) Task: Find salary from schedules where code appears in items entries with matching type. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = schd.type );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18485
train
v1
Schema: orders (alias: ord)(status, date, type, amount) staff(amount, value, level, id) Task: Find amount from orders where code appears in staff entries with matching status. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = ord.status );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18486
train
v3
Schema: tasks (alias: tsk)(type, value, level, salary) items(id, value, level, type) Task: Retrieve code from tasks with salary above the COUNT(salary) of items rows sharing the same level. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18487
train
v2
Schema: customers (alias: cust)(id, date, status, amount) products(type, code, value, amount) Task: Retrieve amount from customers that have at least one corresponding entry in products sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = cust.status );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18488
train
v1
Schema: orders (alias: ord)(level, name, id, status) customers(level, id, salary, code) Task: Retrieve code from orders whose status is found in customers rows where type matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = ord.type );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18489
train
v3
Schema: departments (alias: dept)(level, date, status, value) tasks(name, status, type, salary) Task: Retrieve value from departments with salary above the COUNT(value) of tasks rows sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT COUNT(value) FROM tasks AS tsk WHERE tsk.type = dept.type );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18490
train
v2
Schema: accounts (alias: acct)(status, value, code, type) schedules(code, id, name, level) Task: Retrieve value from accounts that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18491
train
v2
Schema: tasks (alias: tsk)(amount, level, date, type) employees(salary, date, type, value) Task: Retrieve id from tasks that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18492
train
v1
Schema: sales (alias: sale)(type, name, status, date) employees(type, code, amount, level) Task: Find code from sales where level appears in employees entries with matching code. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = sale.code );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18493
train
v2
Schema: staff (alias: empl)(amount, id, status, level) accounts(date, status, value, amount) Task: Find salary from staff where a matching record exists in accounts with the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = empl.status );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18494
train
v1
Schema: regions (alias: rgn)(name, value, amount, salary) managers(code, name, id, type) Task: Retrieve code from regions whose code is found in managers rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18495
train
v1
Schema: branches (alias: brc)(amount, level, date, salary) departments(type, salary, value, name) Task: Find id from branches where status appears in departments entries with matching level. SQL:
SELECT id FROM branches AS brc WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.level = brc.level );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18496
train
v3
Schema: schedules (alias: schd)(type, level, code, value) categories(level, status, code, date) Task: Find name from schedules where value exceeds the total salary from categories for the same code. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18497
train
v2
Schema: projects (alias: prj)(type, status, id, salary) sales(code, salary, value, name) Task: Retrieve value from projects that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = prj.status );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "value", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18498
train
v3
Schema: branches (alias: brc)(level, code, status, id) departments(type, level, status, value) Task: Find id from branches where value exceeds the total value from departments for the same code. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT SUM(value) FROM departments AS dept WHERE dept.code = brc.code );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18499
train