variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: transactions (alias: txn)(amount, status, level, name) projects(code, date, amount, name) Task: Find value from transactions where a matching record exists in projects with the same status. SQL:
SELECT value 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": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17400
train
v2
Schema: staff (alias: empl)(id, code, level, amount) branches(value, salary, code, level) Task: Find code from staff where a matching record exists in branches with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17401
train
v1
Schema: tasks (alias: tsk)(date, type, name, amount) projects(level, value, code, status) Task: Select id from tasks where code exists in projects for the same type. SQL:
SELECT id FROM tasks AS tsk WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17402
train
v2
Schema: shipments (alias: shp)(salary, date, type, name) accounts(date, name, status, type) Task: Find code from shipments where a matching record exists in accounts with the same level. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17403
train
v3
Schema: shipments (alias: shp)(amount, code, value, status) requests(name, value, amount, level) Task: Find name from shipments where salary exceeds the count of value from requests for the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17404
train
v2
Schema: requests (alias: ordr)(name, date, salary, code) invoices(amount, salary, value, level) Task: Retrieve value from requests that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17405
train
v3
Schema: schedules (alias: schd)(date, level, name, type) transactions(status, salary, name, id) Task: Retrieve code from schedules with amount above the MIN(value) of transactions rows sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17406
train
v3
Schema: sales (alias: sale)(value, code, salary, name) branches(code, date, value, amount) Task: Find amount from sales where value exceeds the count of value from branches for the same status. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.status = sale.status );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17407
train
v3
Schema: requests (alias: ordr)(name, level, status, value) managers(value, status, id, date) Task: Retrieve name from requests with amount above the MIN(amount) of managers rows sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17408
train
v1
Schema: invoices (alias: inv)(level, status, name, id) requests(id, date, level, status) Task: Find name from invoices where status appears in requests entries with matching level. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status 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": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17409
train
v2
Schema: schedules (alias: schd)(name, code, date, value) items(name, code, level, amount) Task: Find name from schedules where a matching record exists in items with the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = schd.id );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17410
train
v1
Schema: departments (alias: dept)(code, id, type, name) projects(salary, status, type, value) Task: Find value from departments where code appears in projects entries with matching status. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.status = dept.status );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17411
train
v1
Schema: sales (alias: sale)(type, value, name, code) departments(amount, status, code, salary) Task: Find name from sales where type appears in departments entries with matching type. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = sale.type );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17412
train
v2
Schema: invoices (alias: inv)(code, status, amount, id) departments(level, value, type, amount) Task: Retrieve name from invoices that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17413
train
v3
Schema: transactions (alias: txn)(salary, name, date, value) products(code, value, id, amount) Task: Find name from transactions where value exceeds the average amount from products for the same status. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT AVG(amount) FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17414
train
v3
Schema: employees (alias: emp)(date, level, id, value) requests(name, amount, id, level) Task: Retrieve amount from employees with salary above the MAX(salary) of requests rows sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17415
train
v2
Schema: invoices (alias: inv)(date, amount, value, code) categories(status, id, name, level) Task: Retrieve id from invoices that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17416
train
v2
Schema: branches (alias: brc)(status, value, type, code) categories(value, code, amount, status) Task: Find name from branches where a matching record exists in categories with the same type. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = brc.type );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17417
train
v3
Schema: products (alias: prod)(amount, id, status, level) schedules(status, salary, id, name) Task: Find value from products where salary exceeds the average amount from schedules for the same status. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17418
train
v1
Schema: products (alias: prod)(value, name, id, amount) tasks(level, date, name, amount) Task: Find id from products where id appears in tasks entries with matching id. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = prod.id );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17419
train
v3
Schema: products (alias: prod)(value, code, status, amount) regions(code, amount, value, status) Task: Retrieve amount from products with salary above the COUNT(salary) of regions rows sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17420
train
v1
Schema: categories (alias: catg)(value, status, code, date) products(code, salary, status, value) Task: Retrieve value from categories whose id is found in products rows where type matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17421
train
v1
Schema: managers (alias: mgr)(level, name, status, date) shipments(type, name, salary, level) Task: Find name from managers where status appears in shipments entries with matching code. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17422
train
v2
Schema: schedules (alias: schd)(code, type, id, level) items(value, code, type, salary) Task: Find name from schedules where a matching record exists in items with the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = schd.id );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17423
train
v1
Schema: orders (alias: ord)(date, level, id, amount) branches(value, code, status, amount) Task: Select code from orders where level exists in branches for the same type. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.type = ord.type );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17424
train
v2
Schema: sales (alias: sale)(name, level, salary, value) departments(salary, level, date, amount) Task: Retrieve salary from sales that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17425
train
v3
Schema: customers (alias: cust)(amount, value, level, code) schedules(amount, date, value, status) Task: Find name from customers where salary exceeds the average salary from schedules for the same type. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17426
train
v2
Schema: accounts (alias: acct)(level, status, type, amount) employees(type, value, id, amount) Task: Find id from accounts where a matching record exists in employees with the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17427
train
v3
Schema: transactions (alias: txn)(amount, id, code, date) employees(name, type, code, level) Task: Retrieve amount from transactions with amount above the COUNT(amount) of employees rows sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) 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": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17428
train
v3
Schema: sales (alias: sale)(status, date, level, id) categories(type, amount, id, name) Task: Retrieve salary from sales with amount above the COUNT(amount) of categories rows sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17429
train
v3
Schema: categories (alias: catg)(date, code, level, id) tasks(id, type, name, salary) Task: Retrieve name from categories with amount above the MIN(salary) of tasks rows sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.status = catg.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17430
train
v3
Schema: branches (alias: brc)(status, id, amount, date) regions(name, type, date, salary) Task: Retrieve name from branches with amount above the MIN(amount) of regions rows sharing the same status. SQL:
SELECT name FROM branches AS brc WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = brc.status );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17431
train
v3
Schema: departments (alias: dept)(type, id, date, value) transactions(level, name, salary, amount) Task: Retrieve name from departments with value above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17432
train
v1
Schema: branches (alias: brc)(value, level, code, status) orders(id, type, value, date) Task: Select id from branches where status exists in orders for the same id. SQL:
SELECT id FROM branches AS brc WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.id = brc.id );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17433
train
v2
Schema: products (alias: prod)(code, type, level, salary) tasks(code, salary, value, type) Task: Find value from products where a matching record exists in tasks with the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = prod.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17434
train
v2
Schema: products (alias: prod)(status, value, type, code) tasks(date, code, salary, level) Task: Retrieve value from products that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = prod.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17435
train
v2
Schema: tasks (alias: tsk)(type, salary, date, name) products(type, name, salary, value) Task: Retrieve id from tasks that have at least one corresponding entry in products sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17436
train
v1
Schema: products (alias: prod)(level, id, salary, value) shipments(amount, code, salary, id) Task: Retrieve value from products whose type is found in shipments rows where code matches the outer record. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = prod.code );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17437
train
v3
Schema: categories (alias: catg)(level, value, date, salary) schedules(code, level, id, amount) Task: Find amount from categories where salary exceeds the average salary from schedules for the same level. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17438
train
v1
Schema: orders (alias: ord)(salary, id, name, code) tasks(status, type, value, salary) Task: Find amount from orders where status appears in tasks entries with matching level. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.level = ord.level );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17439
train
v3
Schema: invoices (alias: inv)(type, status, id, name) categories(name, code, type, value) Task: Retrieve amount from invoices with value above the MIN(amount) of categories rows sharing the same id. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17440
train
v3
Schema: shipments (alias: shp)(name, status, level, amount) requests(code, name, salary, type) Task: Retrieve amount from shipments with salary above the MAX(salary) of requests rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17441
train
v3
Schema: projects (alias: prj)(date, value, type, level) categories(name, id, amount, status) Task: Retrieve value from projects with amount above the COUNT(value) of categories rows sharing the same type. SQL:
SELECT value FROM projects AS prj WHERE amount > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17442
train
v2
Schema: orders (alias: ord)(name, date, status, level) branches(level, status, name, code) Task: Find name from orders where a matching record exists in branches with the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = ord.id );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17443
train
v1
Schema: customers (alias: cust)(name, status, salary, type) sales(salary, type, date, value) Task: Find code from customers where status appears in sales entries with matching code. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = cust.code );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17444
train
v2
Schema: orders (alias: ord)(status, name, level, date) shipments(amount, salary, value, name) Task: Find salary from orders where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ord.status );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17445
train
v3
Schema: branches (alias: brc)(amount, name, code, value) categories(status, date, code, type) Task: Find value from branches where amount exceeds the total value from categories for the same id. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT SUM(value) FROM categories AS catg WHERE catg.id = brc.id );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17446
train
v2
Schema: categories (alias: catg)(code, type, name, id) sales(status, salary, level, type) Task: Find name from categories where a matching record exists in sales with the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = catg.code );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17447
train
v3
Schema: staff (alias: empl)(name, status, value, amount) schedules(status, value, type, id) Task: Retrieve code from staff with salary above the MIN(amount) of schedules rows sharing the same status. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.status = empl.status );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17448
train
v2
Schema: staff (alias: empl)(amount, date, value, type) managers(amount, value, type, salary) Task: Retrieve code from staff that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = empl.code );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17449
train
v2
Schema: transactions (alias: txn)(type, code, level, status) items(name, salary, date, status) Task: Retrieve code from transactions that have at least one corresponding entry in items sharing the same code. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17450
train
v3
Schema: tasks (alias: tsk)(amount, code, value, name) staff(level, value, amount, code) Task: Retrieve value from tasks with amount above the COUNT(salary) of staff rows sharing the same id. SQL:
SELECT value FROM tasks AS tsk WHERE amount > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17451
train
v1
Schema: orders (alias: ord)(amount, salary, level, status) employees(name, level, date, type) Task: Select value from orders where level exists in employees for the same code. SQL:
SELECT value FROM orders AS ord WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17452
train
v2
Schema: transactions (alias: txn)(id, type, status, name) regions(code, type, amount, id) Task: Find value from transactions where a matching record exists in regions with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17453
train
v3
Schema: items (alias: lne)(level, date, code, type) orders(code, id, name, status) Task: Retrieve id from items with salary above the SUM(salary) of orders rows sharing the same code. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17454
train
v1
Schema: shipments (alias: shp)(type, amount, code, level) products(amount, type, salary, code) Task: Select value from shipments where type exists in products for the same level. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17455
train
v3
Schema: categories (alias: catg)(amount, status, code, type) invoices(level, salary, id, date) Task: Find name from categories where value exceeds the minimum value from invoices for the same type. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17456
train
v2
Schema: requests (alias: ordr)(level, date, salary, amount) categories(code, name, date, id) Task: Find amount from requests where a matching record exists in categories with the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17457
train
v3
Schema: schedules (alias: schd)(status, amount, date, code) staff(name, code, salary, level) Task: Retrieve value from schedules with salary above the SUM(value) of staff rows sharing the same level. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(value) FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17458
train
v2
Schema: shipments (alias: shp)(status, salary, value, level) customers(id, date, salary, value) Task: Retrieve id from shipments that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = shp.id );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17459
train
v1
Schema: transactions (alias: txn)(status, salary, amount, type) invoices(salary, code, type, name) Task: Select salary from transactions where level exists in invoices for the same id. SQL:
SELECT salary FROM transactions AS txn WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17460
train
v3
Schema: transactions (alias: txn)(date, status, code, name) products(date, name, id, amount) Task: Retrieve value from transactions with value above the MIN(amount) of products rows sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.code = txn.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17461
train
v2
Schema: orders (alias: ord)(salary, date, type, id) managers(level, salary, status, id) Task: Retrieve value from orders that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17462
train
v2
Schema: shipments (alias: shp)(status, value, date, level) accounts(value, amount, code, id) Task: Retrieve value from shipments that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17463
train
v2
Schema: regions (alias: rgn)(type, code, value, id) customers(type, code, salary, value) Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17464
train
v1
Schema: shipments (alias: shp)(date, type, level, code) accounts(id, amount, type, level) Task: Retrieve salary from shipments whose level is found in accounts rows where id matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17465
train
v3
Schema: employees (alias: emp)(status, name, type, date) customers(id, status, date, level) Task: Find id from employees where amount exceeds the minimum value from customers for the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MIN(value) FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17466
train
v3
Schema: requests (alias: ordr)(amount, code, name, id) regions(amount, status, type, date) Task: Find name from requests where amount exceeds the average salary from regions for the same code. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17467
train
v2
Schema: shipments (alias: shp)(id, name, level, date) items(amount, type, id, value) Task: Find name from shipments where a matching record exists in items with the same type. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = shp.type );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17468
train
v3
Schema: orders (alias: ord)(level, amount, id, code) products(value, date, code, level) Task: Retrieve id from orders with amount above the COUNT(amount) of products rows sharing the same status. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.status = ord.status );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17469
train
v3
Schema: customers (alias: cust)(value, level, code, status) employees(type, status, date, id) Task: Retrieve value from customers with salary above the AVG(salary) of employees rows sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17470
train
v2
Schema: shipments (alias: shp)(name, date, value, code) items(type, amount, code, id) Task: Find name from shipments where a matching record exists in items with the same code. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "name", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17471
train
v2
Schema: shipments (alias: shp)(name, type, status, amount) branches(status, id, name, type) Task: Find id from shipments where a matching record exists in branches with the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17472
train
v2
Schema: categories (alias: catg)(level, status, type, name) sales(id, amount, level, status) Task: Find id from categories where a matching record exists in sales with the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = catg.code );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17473
train
v2
Schema: regions (alias: rgn)(id, name, status, amount) invoices(date, name, type, amount) Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17474
train
v3
Schema: products (alias: prod)(date, level, value, name) transactions(status, value, level, salary) Task: Find id from products where amount exceeds the minimum value from transactions for the same level. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.level = prod.level );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17475
train
v2
Schema: products (alias: prod)(salary, status, type, value) departments(status, date, name, id) Task: Find code from products where a matching record exists in departments with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17476
train
v1
Schema: tasks (alias: tsk)(salary, level, amount, name) products(code, value, id, status) Task: Select id from tasks where code exists in products for the same id. SQL:
SELECT id FROM tasks AS tsk WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17477
train
v3
Schema: sales (alias: sale)(value, name, date, salary) schedules(value, date, salary, level) Task: Find salary from sales where salary exceeds the minimum salary from schedules for the same code. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.code = sale.code );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17478
train
v1
Schema: transactions (alias: txn)(id, salary, amount, status) departments(value, level, date, type) Task: Find value from transactions where code appears in departments entries with matching id. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17479
train
v3
Schema: branches (alias: brc)(type, id, status, amount) sales(name, amount, type, value) Task: Find id from branches where value exceeds the maximum value from sales for the same type. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.type = brc.type );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17480
train
v3
Schema: tasks (alias: tsk)(level, value, name, status) requests(amount, status, salary, type) Task: Find value from tasks where value exceeds the count of amount from requests for the same code. SQL:
SELECT value FROM tasks AS tsk WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17481
train
v3
Schema: transactions (alias: txn)(type, amount, id, date) accounts(date, status, id, value) Task: Retrieve name from transactions with value above the COUNT(amount) of accounts rows sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17482
train
v1
Schema: staff (alias: empl)(name, code, type, id) tasks(amount, salary, code, status) Task: Retrieve id from staff whose code is found in tasks rows where type matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.type = empl.type );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17483
train
v3
Schema: products (alias: prod)(amount, status, code, value) managers(name, type, status, id) Task: Find amount from products where salary exceeds the count of amount from managers for the same status. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17484
train
v2
Schema: staff (alias: empl)(date, amount, status, code) invoices(code, salary, status, value) Task: Retrieve amount from staff that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = empl.level );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17485
train
v2
Schema: transactions (alias: txn)(amount, code, type, salary) projects(amount, name, code, type) Task: Find name from transactions where a matching record exists in projects with the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = txn.code );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17486
train
v2
Schema: orders (alias: ord)(salary, status, name, date) branches(name, level, amount, status) Task: Retrieve name from orders that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = ord.status );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17487
train
v1
Schema: orders (alias: ord)(amount, value, level, status) accounts(status, level, date, value) Task: Retrieve salary from orders whose type is found in accounts rows where id matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17488
train
v3
Schema: customers (alias: cust)(name, code, level, value) managers(level, id, type, salary) Task: Retrieve code from customers with salary above the SUM(amount) of managers rows sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17489
train
v3
Schema: requests (alias: ordr)(salary, date, type, code) schedules(value, code, amount, level) Task: Find id from requests where value exceeds the maximum amount from schedules for the same code. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17490
train
v3
Schema: sales (alias: sale)(salary, id, level, status) employees(date, id, value, name) Task: Find amount from sales where salary exceeds the total amount from employees for the same level. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.level = sale.level );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17491
train
v1
Schema: departments (alias: dept)(level, code, value, id) branches(value, amount, date, salary) Task: Retrieve code from departments whose code is found in branches rows where level matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17492
train
v1
Schema: staff (alias: empl)(status, id, code, type) orders(level, id, status, value) Task: Retrieve name from staff whose level is found in orders rows where level matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17493
train
v3
Schema: accounts (alias: acct)(value, id, status, level) invoices(level, type, date, value) Task: Find salary from accounts where value exceeds the total value from invoices for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17494
train
v3
Schema: accounts (alias: acct)(id, type, salary, value) requests(type, date, salary, amount) Task: Retrieve name from accounts with value above the SUM(salary) of requests rows sharing the same level. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17495
train
v1
Schema: orders (alias: ord)(code, name, id, type) projects(value, level, name, status) Task: Select salary from orders where status exists in projects for the same level. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = ord.level );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17496
train
v1
Schema: items (alias: lne)(status, amount, id, date) sales(status, type, name, value) Task: Select code from items where type exists in sales for the same type. SQL:
SELECT code FROM items AS lne WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17497
train
v3
Schema: categories (alias: catg)(type, status, value, id) requests(code, name, level, amount) Task: Retrieve code from categories with salary above the SUM(value) of requests rows sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17498
train
v1
Schema: categories (alias: catg)(name, value, status, level) orders(level, amount, value, date) Task: Select name from categories where level exists in orders for the same level. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = catg.level );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17499
train