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: employees (alias: emp)(name, id, code, amount) managers(salary, id, status, amount) Task: Retrieve value from employees with salary above the MIN(amount) of managers rows sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12400
train
v3
Schema: departments (alias: dept)(id, type, name, value) managers(status, name, id, amount) Task: Find id from departments where amount exceeds the maximum amount from managers for the same id. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12401
train
v3
Schema: departments (alias: dept)(status, name, type, code) employees(value, type, name, level) Task: Find name from departments where amount exceeds the average value from employees for the same level. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12402
train
v3
Schema: invoices (alias: inv)(value, status, level, name) tasks(name, salary, code, level) Task: Find name from invoices where amount exceeds the count of value from tasks for the same code. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT COUNT(value) FROM tasks AS tsk WHERE tsk.code = inv.code );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12403
train
v1
Schema: schedules (alias: schd)(value, id, type, salary) regions(code, status, value, type) Task: Find salary from schedules where code appears in regions entries with matching status. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12404
train
v2
Schema: employees (alias: emp)(type, level, id, amount) branches(type, amount, id, level) Task: Retrieve name from employees that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = emp.code );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12405
train
v1
Schema: regions (alias: rgn)(name, date, type, level) orders(name, id, level, type) Task: Find name from regions where type appears in orders entries with matching id. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12406
train
v2
Schema: staff (alias: empl)(status, name, code, salary) tasks(date, name, value, level) Task: Find id from staff where a matching record exists in tasks with the same id. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = empl.id );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12407
train
v3
Schema: accounts (alias: acct)(id, date, level, salary) customers(type, code, level, salary) Task: Find amount from accounts where salary exceeds the count of salary from customers for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.id = acct.id );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12408
train
v1
Schema: sales (alias: sale)(salary, amount, type, level) categories(status, amount, salary, name) Task: Select salary from sales where level exists in categories for the same status. SQL:
SELECT salary FROM sales AS sale WHERE level IN ( SELECT level 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": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12409
train
v3
Schema: staff (alias: empl)(status, salary, level, date) accounts(level, id, date, amount) Task: Find code from staff where salary exceeds the maximum salary from accounts for the same status. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.status = empl.status );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12410
train
v3
Schema: sales (alias: sale)(amount, status, date, salary) customers(salary, value, code, id) Task: Retrieve value from sales with amount above the SUM(value) of customers rows sharing the same type. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM customers AS cust WHERE cust.type = sale.type );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12411
train
v3
Schema: regions (alias: rgn)(type, code, name, level) projects(value, date, status, salary) Task: Find code from regions where salary exceeds the minimum amount from projects for the same level. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.level = rgn.level );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12412
train
v2
Schema: tasks (alias: tsk)(id, code, level, status) transactions(amount, level, type, date) Task: Find code from tasks where a matching record exists in transactions with the same level. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12413
train
v1
Schema: categories (alias: catg)(status, id, level, name) products(name, date, level, code) Task: Find id from categories where id appears in products entries with matching type. SQL:
SELECT id 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": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12414
train
v2
Schema: products (alias: prod)(id, type, amount, salary) departments(date, salary, id, value) Task: Find id from products where a matching record exists in departments with the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12415
train
v1
Schema: regions (alias: rgn)(salary, date, amount, code) products(amount, date, salary, level) Task: Select amount from regions where level exists in products for the same type. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12416
train
v3
Schema: shipments (alias: shp)(amount, salary, type, name) regions(type, value, code, level) Task: Find salary from shipments where value exceeds the maximum salary from regions for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12417
train
v2
Schema: items (alias: lne)(salary, level, value, code) staff(name, type, amount, level) Task: Retrieve code from items that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = lne.status );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12418
train
v2
Schema: tasks (alias: tsk)(date, value, name, amount) requests(id, salary, type, name) Task: Find name from tasks where a matching record exists in requests with the same level. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "name", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12419
train
v3
Schema: employees (alias: emp)(status, date, salary, value) transactions(level, salary, value, type) Task: Retrieve value from employees with value above the MIN(salary) of transactions rows sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.code = emp.code );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12420
train
v3
Schema: customers (alias: cust)(status, id, type, amount) items(code, type, salary, date) Task: Retrieve name from customers with salary above the MIN(salary) of items rows sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = cust.id );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12421
train
v1
Schema: requests (alias: ordr)(type, name, date, status) projects(name, amount, salary, value) Task: Select code from requests where level exists in projects for the same type. SQL:
SELECT code FROM requests AS ordr WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = ordr.type );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12422
train
v1
Schema: orders (alias: ord)(salary, name, type, status) schedules(value, salary, amount, status) Task: Select value from orders where id exists in schedules for the same code. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12423
train
v3
Schema: staff (alias: empl)(name, date, id, salary) departments(id, value, salary, amount) Task: Find name from staff where value exceeds the count of value from departments for the same type. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.type = empl.type );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12424
train
v2
Schema: categories (alias: catg)(salary, name, id, code) managers(date, id, name, amount) Task: Retrieve id from categories that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = catg.id );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12425
train
v3
Schema: branches (alias: brc)(value, level, code, amount) invoices(code, status, value, amount) Task: Retrieve name from branches with salary above the MAX(salary) of invoices rows sharing the same code. SQL:
SELECT name FROM branches AS brc WHERE salary > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.code = brc.code );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12426
train
v1
Schema: items (alias: lne)(amount, code, value, id) invoices(name, type, code, amount) Task: Find value from items where type appears in invoices entries with matching code. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12427
train
v2
Schema: tasks (alias: tsk)(date, id, amount, name) orders(type, amount, id, status) Task: Retrieve id from tasks that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12428
train
v2
Schema: departments (alias: dept)(date, value, status, name) tasks(type, salary, level, date) Task: Retrieve id from departments that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = dept.id );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12429
train
v1
Schema: managers (alias: mgr)(amount, type, level, code) items(amount, type, status, date) Task: Select amount from managers where level exists in items for the same code. SQL:
SELECT amount FROM managers AS mgr WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = mgr.code );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12430
train
v1
Schema: schedules (alias: schd)(value, code, type, salary) tasks(amount, name, code, status) Task: Find salary from schedules where type appears in tasks entries with matching type. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.type = schd.type );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12431
train
v2
Schema: managers (alias: mgr)(level, code, name, date) transactions(salary, name, type, value) Task: Find id from managers where a matching record exists in transactions with the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12432
train
v3
Schema: regions (alias: rgn)(level, amount, name, id) managers(level, amount, status, type) Task: Find amount from regions where amount exceeds the count of salary from managers for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12433
train
v2
Schema: managers (alias: mgr)(value, code, status, salary) transactions(value, status, type, date) Task: Retrieve code from managers that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12434
train
v2
Schema: branches (alias: brc)(id, level, name, status) shipments(date, code, level, id) Task: Retrieve code from branches that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = brc.type );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12435
train
v3
Schema: regions (alias: rgn)(type, salary, level, code) requests(amount, status, value, code) Task: Retrieve id from regions with salary above the SUM(salary) of requests rows sharing the same type. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12436
train
v3
Schema: managers (alias: mgr)(type, name, level, status) invoices(id, date, value, amount) Task: Retrieve value from managers with amount above the MAX(amount) of invoices rows sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.code = mgr.code );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12437
train
v3
Schema: requests (alias: ordr)(value, status, id, salary) departments(status, date, value, salary) Task: Find name from requests where salary exceeds the maximum salary from departments for the same code. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.code = ordr.code );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12438
train
v2
Schema: orders (alias: ord)(code, level, amount, value) items(id, code, status, level) Task: Retrieve amount from orders that have at least one corresponding entry in items sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = ord.code );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "amount", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12439
train
v1
Schema: employees (alias: emp)(code, date, id, amount) requests(name, amount, level, status) Task: Retrieve value from employees whose code is found in requests rows where type matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12440
train
v3
Schema: customers (alias: cust)(status, level, name, code) projects(date, salary, type, amount) Task: Find salary from customers where salary exceeds the average value from projects for the same code. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT AVG(value) FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12441
train
v2
Schema: employees (alias: emp)(salary, status, value, name) orders(amount, value, id, level) Task: Find amount from employees where a matching record exists in orders with the same status. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = emp.status );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12442
train
v1
Schema: projects (alias: prj)(amount, date, id, name) regions(date, id, type, level) Task: Retrieve name from projects whose type is found in regions rows where level matches the outer record. SQL:
SELECT name FROM projects AS prj WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12443
train
v1
Schema: managers (alias: mgr)(id, name, salary, date) regions(amount, value, status, type) Task: Retrieve salary from managers whose code is found in regions rows where type matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12444
train
v2
Schema: shipments (alias: shp)(name, level, type, id) requests(id, type, amount, status) Task: Find value from shipments where a matching record exists in requests with the same level. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12445
train
v2
Schema: transactions (alias: txn)(level, value, date, code) items(salary, code, type, value) Task: Find code from transactions where a matching record exists in items with the same level. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12446
train
v1
Schema: accounts (alias: acct)(level, type, id, value) staff(value, type, date, amount) Task: Retrieve salary from accounts whose type is found in staff rows where level matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12447
train
v2
Schema: items (alias: lne)(type, value, name, status) shipments(id, name, amount, type) Task: Find code from items where a matching record exists in shipments with the same type. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12448
train
v2
Schema: items (alias: lne)(date, value, name, type) accounts(status, id, value, date) Task: Retrieve code from items that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = lne.level );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12449
train
v3
Schema: projects (alias: prj)(date, type, salary, status) items(date, salary, code, value) Task: Find name from projects where salary exceeds the total value from items for the same id. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT SUM(value) FROM items AS lne WHERE lne.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_12450
train
v1
Schema: requests (alias: ordr)(salary, level, amount, id) projects(name, level, type, status) Task: Retrieve id from requests whose id is found in projects rows where code matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = ordr.code );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12451
train
v2
Schema: schedules (alias: schd)(amount, type, date, salary) branches(name, amount, id, type) Task: Find id from schedules where a matching record exists in branches with the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12452
train
v1
Schema: regions (alias: rgn)(type, level, id, code) requests(amount, value, type, status) Task: Select name from regions where id exists in requests for the same code. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12453
train
v1
Schema: accounts (alias: acct)(amount, date, value, name) categories(id, type, date, code) Task: Find value from accounts where level appears in categories entries with matching type. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12454
train
v1
Schema: tasks (alias: tsk)(amount, salary, type, date) orders(salary, type, code, name) Task: Find amount from tasks where code appears in orders entries with matching code. SQL:
SELECT amount FROM tasks AS tsk WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12455
train
v2
Schema: accounts (alias: acct)(date, amount, id, value) employees(date, level, id, value) Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12456
train
v1
Schema: transactions (alias: txn)(type, salary, id, amount) projects(amount, date, code, id) Task: Select id from transactions where type exists in projects for the same id. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = txn.id );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12457
train
v1
Schema: accounts (alias: acct)(date, id, type, code) branches(date, type, value, status) Task: Find salary from accounts where code appears in branches entries with matching status. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12458
train
v3
Schema: branches (alias: brc)(amount, name, status, type) tasks(value, amount, id, salary) Task: Find value from branches where amount exceeds the average amount from tasks for the same id. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.id = brc.id );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12459
train
v3
Schema: shipments (alias: shp)(value, salary, status, type) categories(salary, level, name, code) Task: Retrieve salary from shipments with salary above the AVG(amount) of categories rows sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.code = shp.code );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12460
train
v1
Schema: customers (alias: cust)(value, amount, code, id) staff(code, salary, type, status) Task: Find code from customers where id appears in staff entries with matching type. SQL:
SELECT code FROM customers AS cust WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12461
train
v2
Schema: requests (alias: ordr)(salary, code, name, level) managers(status, type, value, code) Task: Retrieve salary from requests that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12462
train
v3
Schema: branches (alias: brc)(type, id, name, salary) transactions(name, code, level, date) Task: Find code from branches where value exceeds the total salary from transactions for the same type. SQL:
SELECT code FROM branches AS brc WHERE value > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.type = brc.type );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_12463
train
v3
Schema: regions (alias: rgn)(status, salary, code, name) categories(status, code, date, level) Task: Find salary from regions where value exceeds the count of salary from categories for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12464
train
v3
Schema: managers (alias: mgr)(value, level, date, type) staff(name, date, amount, type) Task: Retrieve id from managers with amount above the SUM(value) of staff rows sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT SUM(value) FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12465
train
v1
Schema: categories (alias: catg)(name, value, code, type) transactions(name, id, level, value) Task: Select name from categories where type exists in transactions for the same id. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12466
train
v3
Schema: managers (alias: mgr)(name, date, id, amount) orders(code, salary, amount, status) Task: Find amount from managers where value exceeds the minimum salary from orders for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12467
train
v2
Schema: requests (alias: ordr)(amount, id, code, value) accounts(code, type, salary, date) Task: Retrieve name from requests that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = ordr.code );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12468
train
v3
Schema: sales (alias: sale)(type, status, value, date) categories(amount, name, type, status) Task: Find value from sales where salary exceeds the average amount from categories for the same level. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12469
train
v2
Schema: staff (alias: empl)(id, amount, value, status) transactions(id, code, status, date) Task: Retrieve id from staff that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12470
train
v2
Schema: orders (alias: ord)(code, amount, date, level) requests(id, code, date, salary) Task: Find value from orders where a matching record exists in requests with the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12471
train
v2
Schema: shipments (alias: shp)(code, name, amount, status) transactions(salary, date, code, type) Task: Find id from shipments where a matching record exists in transactions with the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_12472
train
v2
Schema: tasks (alias: tsk)(date, id, code, name) products(level, value, date, salary) Task: Retrieve salary from tasks that have at least one corresponding entry in products sharing the same status. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_12473
train
v2
Schema: employees (alias: emp)(name, salary, type, value) shipments(code, amount, salary, type) Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12474
train
v1
Schema: managers (alias: mgr)(type, id, level, salary) staff(type, status, level, code) Task: Find amount from managers where code appears in staff entries with matching type. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12475
train
v1
Schema: transactions (alias: txn)(level, status, value, amount) regions(type, id, level, salary) Task: Retrieve salary from transactions whose status is found in regions rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12476
train
v3
Schema: invoices (alias: inv)(name, salary, amount, id) shipments(id, status, salary, amount) Task: Find id from invoices where value exceeds the total value from shipments for the same id. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12477
train
v3
Schema: staff (alias: empl)(value, id, salary, level) items(status, salary, code, value) Task: Retrieve id from staff with amount above the MIN(salary) of items rows sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MIN(salary) FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_12478
train
v2
Schema: transactions (alias: txn)(type, salary, date, status) departments(date, amount, value, level) Task: Find value from transactions where a matching record exists in departments with the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12479
train
v3
Schema: orders (alias: ord)(level, date, name, id) requests(level, id, salary, type) Task: Retrieve code from orders with amount above the MAX(salary) of requests rows sharing the same type. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.type = ord.type );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12480
train
v2
Schema: regions (alias: rgn)(value, level, date, code) schedules(amount, status, salary, date) Task: Find code from regions where a matching record exists in schedules with the same type. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = rgn.type );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12481
train
v3
Schema: items (alias: lne)(salary, value, status, date) employees(amount, type, status, level) Task: Retrieve amount from items with salary above the AVG(amount) of employees rows sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.level = lne.level );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12482
train
v3
Schema: regions (alias: rgn)(type, salary, status, code) products(amount, date, id, salary) Task: Retrieve salary from regions with amount above the SUM(amount) of products rows sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT SUM(amount) FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12483
train
v2
Schema: items (alias: lne)(code, id, type, salary) accounts(type, date, status, amount) Task: Retrieve id from items that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12484
train
v1
Schema: products (alias: prod)(level, date, salary, type) accounts(name, id, status, code) Task: Retrieve code from products whose level is found in accounts rows where id matches the outer record. SQL:
SELECT code FROM products AS prod WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12485
train
v1
Schema: departments (alias: dept)(type, level, value, amount) branches(value, salary, id, status) Task: Retrieve amount from departments whose code is found in branches rows where id matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = dept.id );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12486
train
v1
Schema: requests (alias: ordr)(salary, amount, date, status) shipments(date, code, level, type) Task: Select salary from requests where status exists in shipments for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12487
train
v1
Schema: requests (alias: ordr)(date, value, id, level) staff(status, salary, type, id) Task: Find id from requests where id appears in staff entries with matching id. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = ordr.id );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12488
train
v2
Schema: requests (alias: ordr)(type, name, value, level) accounts(status, id, name, salary) Task: Retrieve name from requests that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = ordr.code );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_12489
train
v3
Schema: items (alias: lne)(level, amount, salary, value) accounts(value, code, status, name) Task: Retrieve id from items with value above the SUM(salary) of accounts rows sharing the same type. SQL:
SELECT id FROM items AS lne WHERE value > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_12490
train
v3
Schema: categories (alias: catg)(name, value, level, status) regions(type, code, status, value) Task: Retrieve name from categories with value above the AVG(value) of regions rows sharing the same level. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12491
train
v2
Schema: products (alias: prod)(level, date, salary, code) tasks(name, code, salary, type) Task: Retrieve name from products that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12492
train
v1
Schema: managers (alias: mgr)(salary, id, value, amount) transactions(date, level, id, amount) Task: Retrieve salary from managers whose level is found in transactions rows where status matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12493
train
v1
Schema: transactions (alias: txn)(date, type, salary, code) tasks(name, amount, date, status) Task: Retrieve code from transactions whose id is found in tasks rows where level matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = txn.level );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12494
train
v1
Schema: regions (alias: rgn)(status, name, level, type) managers(amount, id, type, date) Task: Select salary from regions where id exists in managers for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_12495
train
v1
Schema: sales (alias: sale)(level, date, name, value) orders(salary, amount, id, type) Task: Find name from sales where level appears in orders entries with matching status. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12496
train
v2
Schema: sales (alias: sale)(amount, id, status, date) projects(name, type, amount, id) Task: Retrieve code from sales that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12497
train
v1
Schema: invoices (alias: inv)(amount, id, status, name) products(type, date, amount, id) Task: Select value from invoices where status exists in products for the same level. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = inv.level );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_12498
train
v2
Schema: schedules (alias: schd)(id, salary, status, code) transactions(name, code, amount, date) Task: Retrieve salary from schedules that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_12499
train