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: accounts (alias: acct)(type, date, id, amount) staff(code, value, level, date) Task: Find amount from accounts where amount exceeds the count of value from staff for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.code = acct.code );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03200
train
v3
Schema: sales (alias: sale)(status, id, level, amount) regions(type, value, level, date) Task: Retrieve code from sales with value above the MIN(salary) of regions rows sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.code = sale.code );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03201
train
v3
Schema: schedules (alias: schd)(level, date, status, id) staff(name, amount, type, date) Task: Find value from schedules where value exceeds the average value from staff for the same id. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03202
train
v2
Schema: schedules (alias: schd)(salary, code, status, level) projects(date, salary, type, value) Task: Find name from schedules where a matching record exists in projects with the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = schd.status );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03203
train
v2
Schema: employees (alias: emp)(name, date, value, type) requests(status, salary, name, amount) Task: Retrieve amount from employees that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03204
train
v1
Schema: staff (alias: empl)(id, name, type, date) transactions(type, name, value, code) Task: Select code from staff where type exists in transactions for the same type. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03205
train
v2
Schema: categories (alias: catg)(salary, type, amount, id) departments(type, value, id, amount) Task: Find amount from categories where a matching record exists in departments with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03206
train
v2
Schema: categories (alias: catg)(amount, type, status, id) orders(amount, level, id, salary) Task: Find salary from categories where a matching record exists in orders with the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = catg.type );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03207
train
v1
Schema: invoices (alias: inv)(type, id, level, code) orders(level, type, status, amount) Task: Retrieve name from invoices whose status is found in orders rows where status matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03208
train
v2
Schema: departments (alias: dept)(level, salary, value, type) branches(date, code, type, level) Task: Find value from departments where a matching record exists in branches with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = dept.code );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03209
train
v3
Schema: branches (alias: brc)(type, name, date, amount) categories(value, code, name, id) Task: Retrieve salary from branches with value above the COUNT(salary) of categories rows sharing the same level. SQL:
SELECT salary FROM branches AS brc WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.level = brc.level );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03210
train
v3
Schema: orders (alias: ord)(date, name, status, value) shipments(id, value, status, date) Task: Retrieve id from orders with amount above the AVG(value) of shipments rows sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.code = ord.code );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03211
train
v1
Schema: shipments (alias: shp)(id, type, salary, level) orders(salary, date, name, type) Task: Select code from shipments where type exists in orders for the same status. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03212
train
v2
Schema: departments (alias: dept)(code, type, salary, status) accounts(amount, name, salary, id) Task: Retrieve salary from departments that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03213
train
v1
Schema: items (alias: lne)(code, date, salary, status) managers(value, type, status, name) Task: Retrieve salary from items whose status is found in managers rows where code matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = lne.code );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03214
train
v1
Schema: orders (alias: ord)(level, name, code, date) managers(value, salary, date, type) Task: Select value from orders where level exists in managers for the same code. SQL:
SELECT value FROM orders AS ord WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03215
train
v3
Schema: schedules (alias: schd)(name, type, status, code) requests(status, type, amount, code) Task: Find code from schedules where salary exceeds the minimum amount from requests for the same level. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03216
train
v1
Schema: managers (alias: mgr)(id, type, salary, date) branches(value, amount, date, level) Task: Select amount from managers where code exists in branches for the same type. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03217
train
v2
Schema: products (alias: prod)(id, value, name, date) branches(name, status, level, code) Task: Retrieve amount from products that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03218
train
v1
Schema: departments (alias: dept)(salary, amount, type, status) categories(date, name, salary, value) Task: Retrieve name from departments whose type is found in categories rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.code = dept.code );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03219
train
v2
Schema: employees (alias: emp)(code, date, id, salary) projects(value, salary, amount, level) Task: Retrieve amount from employees that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = emp.id );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03220
train
v1
Schema: invoices (alias: inv)(name, id, level, code) employees(salary, level, type, value) Task: Retrieve amount from invoices whose status is found in employees rows where type matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03221
train
v3
Schema: invoices (alias: inv)(code, level, id, value) employees(level, type, code, id) Task: Retrieve value from invoices with amount above the MIN(salary) of employees rows sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03222
train
v3
Schema: products (alias: prod)(status, date, code, amount) managers(level, date, salary, amount) Task: Find name from products where salary exceeds the total value from managers for the same type. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03223
train
v3
Schema: orders (alias: ord)(type, code, amount, status) transactions(code, amount, date, salary) Task: Retrieve amount from orders with amount above the COUNT(value) of transactions rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03224
train
v1
Schema: invoices (alias: inv)(type, date, level, value) customers(name, type, level, value) Task: Retrieve id from invoices whose status is found in customers rows where id matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03225
train
v2
Schema: invoices (alias: inv)(id, type, value, code) tasks(code, level, type, value) Task: Retrieve code from invoices that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03226
train
v2
Schema: projects (alias: prj)(code, name, id, status) requests(level, type, id, value) Task: Retrieve name from projects that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = prj.id );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03227
train
v2
Schema: managers (alias: mgr)(code, id, salary, status) orders(type, name, code, amount) Task: Find code from managers where a matching record exists in orders with the same code. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = mgr.code );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03228
train
v2
Schema: sales (alias: sale)(type, status, value, level) branches(value, id, status, level) Task: Find code from sales where a matching record exists in branches with the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = sale.level );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03229
train
v2
Schema: categories (alias: catg)(date, salary, name, code) projects(date, id, salary, type) Task: Retrieve salary from categories that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = catg.status );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03230
train
v3
Schema: categories (alias: catg)(level, type, status, date) departments(type, value, amount, date) Task: Retrieve amount from categories with value above the COUNT(value) of departments rows sharing the same code. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03231
train
v2
Schema: accounts (alias: acct)(salary, type, code, id) employees(name, status, value, code) Task: Find code from accounts where a matching record exists in employees with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03232
train
v1
Schema: items (alias: lne)(level, name, code, date) managers(status, date, amount, level) Task: Retrieve id from items whose type is found in managers rows where status matches the outer record. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03233
train
v1
Schema: sales (alias: sale)(level, amount, id, type) customers(date, type, id, amount) Task: Retrieve name from sales whose type is found in customers rows where level matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03234
train
v2
Schema: shipments (alias: shp)(amount, value, type, status) schedules(date, salary, id, amount) Task: Retrieve name from shipments that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03235
train
v2
Schema: schedules (alias: schd)(name, level, code, amount) employees(code, date, name, amount) Task: Retrieve amount from schedules that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03236
train
v1
Schema: items (alias: lne)(name, amount, type, code) departments(amount, status, id, value) Task: Retrieve salary from items whose id is found in departments rows where code matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.code = lne.code );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03237
train
v3
Schema: transactions (alias: txn)(id, salary, amount, name) branches(date, id, amount, type) Task: Retrieve code from transactions with value above the COUNT(amount) of branches rows sharing the same id. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03238
train
v1
Schema: products (alias: prod)(date, amount, level, id) transactions(name, salary, type, date) Task: Retrieve code from products whose code is found in transactions rows where id matches the outer record. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03239
train
v2
Schema: shipments (alias: shp)(amount, level, date, code) orders(id, value, status, code) Task: Retrieve value from shipments that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03240
train
v3
Schema: products (alias: prod)(date, code, type, name) managers(type, date, name, id) Task: Retrieve name from products with amount above the MAX(value) of managers rows sharing the same status. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03241
train
v1
Schema: regions (alias: rgn)(status, level, salary, type) managers(date, name, amount, type) Task: Retrieve code from regions whose id is found in managers rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03242
train
v3
Schema: regions (alias: rgn)(type, salary, value, level) transactions(level, id, status, code) Task: Retrieve id from regions with amount above the AVG(salary) of transactions rows sharing the same id. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.id = rgn.id );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03243
train
v1
Schema: requests (alias: ordr)(status, name, salary, type) employees(status, id, value, date) Task: Retrieve value from requests whose status is found in employees rows where level matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03244
train
v3
Schema: staff (alias: empl)(status, salary, code, id) accounts(value, amount, name, type) Task: Retrieve amount from staff with salary above the SUM(salary) of accounts rows sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03245
train
v1
Schema: projects (alias: prj)(salary, level, code, type) categories(name, status, id, code) Task: Select name from projects where code exists in categories for the same level. SQL:
SELECT name FROM projects AS prj WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = prj.level );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03246
train
v3
Schema: branches (alias: brc)(level, name, status, id) regions(amount, code, value, id) Task: Retrieve name from branches with value above the SUM(salary) of regions rows sharing the same code. SQL:
SELECT name FROM branches AS brc WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.code = brc.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03247
train
v2
Schema: managers (alias: mgr)(salary, level, status, date) employees(name, date, salary, type) Task: Find salary from managers where a matching record exists in employees with the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03248
train
v3
Schema: employees (alias: emp)(amount, date, type, code) categories(level, id, salary, name) Task: Find name from employees where value exceeds the total salary from categories for the same type. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03249
train
v2
Schema: sales (alias: sale)(type, salary, level, date) categories(type, value, salary, amount) Task: Find name from sales where a matching record exists in categories with the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03250
train
v2
Schema: items (alias: lne)(id, status, code, amount) categories(value, status, level, id) Task: Retrieve amount from items that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = lne.level );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03251
train
v1
Schema: sales (alias: sale)(amount, salary, level, id) items(status, level, id, salary) Task: Retrieve amount from sales whose type is found in items rows where status matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03252
train
v3
Schema: customers (alias: cust)(salary, code, date, amount) managers(name, type, level, code) Task: Retrieve amount from customers with amount above the SUM(value) of managers rows sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03253
train
v1
Schema: schedules (alias: schd)(salary, level, amount, code) requests(id, type, name, value) Task: Find value from schedules where id appears in requests entries with matching type. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.type = schd.type );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03254
train
v3
Schema: orders (alias: ord)(date, value, name, amount) items(amount, date, code, level) Task: Find code from orders where value exceeds the count of amount from items for the same type. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03255
train
v2
Schema: transactions (alias: txn)(amount, salary, code, status) schedules(name, salary, type, code) Task: Retrieve code from transactions that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03256
train
v3
Schema: tasks (alias: tsk)(name, amount, date, type) branches(date, value, type, status) Task: Retrieve salary from tasks with salary above the AVG(salary) of branches rows sharing the same type. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03257
train
v3
Schema: orders (alias: ord)(value, id, name, amount) schedules(salary, type, name, value) Task: Retrieve code from orders with amount above the SUM(value) of schedules rows sharing the same level. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03258
train
v3
Schema: tasks (alias: tsk)(level, status, type, code) orders(id, name, status, value) Task: Find amount from tasks where value exceeds the minimum amount from orders for the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03259
train
v3
Schema: orders (alias: ord)(date, salary, name, status) managers(amount, salary, code, status) Task: Find value from orders where amount exceeds the total value from managers for the same level. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03260
train
v3
Schema: schedules (alias: schd)(salary, date, level, id) branches(level, type, salary, date) Task: Find name from schedules where value exceeds the total amount from branches for the same level. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03261
train
v3
Schema: schedules (alias: schd)(level, amount, code, name) shipments(name, type, id, value) Task: Find code from schedules where value exceeds the maximum value from shipments for the same type. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03262
train
v2
Schema: shipments (alias: shp)(id, amount, status, level) products(value, date, name, salary) Task: Retrieve id from shipments that have at least one corresponding entry in products sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = shp.id );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03263
train
v2
Schema: projects (alias: prj)(level, name, value, id) accounts(level, status, amount, code) Task: Retrieve amount from projects that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = prj.code );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03264
train
v2
Schema: orders (alias: ord)(level, amount, status, salary) employees(status, level, code, id) Task: Retrieve value from orders that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = ord.type );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03265
train
v3
Schema: branches (alias: brc)(level, id, name, type) departments(name, id, type, date) Task: Retrieve id from branches with amount above the MAX(value) of departments rows sharing the same code. SQL:
SELECT id FROM branches AS brc WHERE amount > ( SELECT MAX(value) FROM departments AS dept WHERE dept.code = brc.code );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03266
train
v2
Schema: projects (alias: prj)(level, value, amount, name) customers(value, code, amount, date) Task: Find value from projects where a matching record exists in customers with the same status. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = prj.status );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "value", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03267
train
v2
Schema: invoices (alias: inv)(amount, level, salary, value) categories(salary, level, code, date) Task: Find value from invoices where a matching record exists in categories with the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03268
train
v3
Schema: managers (alias: mgr)(salary, id, status, level) shipments(date, value, level, status) Task: Retrieve id from managers with value above the SUM(value) of shipments rows sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03269
train
v3
Schema: accounts (alias: acct)(level, status, name, type) requests(salary, status, id, type) Task: Find salary from accounts where amount exceeds the count of salary from requests for the same status. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03270
train
v1
Schema: shipments (alias: shp)(name, type, code, salary) branches(value, code, date, amount) Task: Retrieve amount from shipments whose id is found in branches rows where status matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = shp.status );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03271
train
v2
Schema: items (alias: lne)(level, amount, value, type) invoices(amount, date, value, status) Task: Retrieve name from items that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03272
train
v3
Schema: employees (alias: emp)(id, status, name, amount) items(date, name, type, level) Task: Retrieve id from employees with value above the SUM(salary) of items rows sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.id = emp.id );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03273
train
v3
Schema: staff (alias: empl)(name, date, type, value) transactions(status, level, type, value) Task: Retrieve amount from staff with value above the MIN(salary) of transactions rows sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.code = empl.code );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03274
train
v2
Schema: products (alias: prod)(amount, date, value, type) regions(salary, level, code, amount) Task: Find value from products where a matching record exists in regions with the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = prod.level );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03275
train
v1
Schema: categories (alias: catg)(date, type, level, value) products(code, amount, id, status) Task: Find amount from categories where type appears in products entries with matching code. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03276
train
v2
Schema: products (alias: prod)(date, id, salary, status) shipments(salary, name, amount, code) Task: Find code from products where a matching record exists in shipments with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = prod.code );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03277
train
v2
Schema: branches (alias: brc)(amount, type, code, date) transactions(id, status, value, name) Task: Find id from branches where a matching record exists in transactions with the same id. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = brc.id );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03278
train
v3
Schema: invoices (alias: inv)(status, salary, type, value) schedules(value, salary, level, amount) Task: Retrieve salary from invoices with salary above the MAX(amount) of schedules rows sharing the same level. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.level = inv.level );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03279
train
v3
Schema: managers (alias: mgr)(level, salary, code, status) employees(amount, level, value, id) Task: Retrieve name from managers with amount above the COUNT(salary) of employees rows sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03280
train
v1
Schema: items (alias: lne)(name, date, amount, code) staff(name, amount, salary, value) Task: Select salary from items where status exists in staff for the same id. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03281
train
v2
Schema: invoices (alias: inv)(name, code, id, amount) categories(type, name, amount, salary) Task: Find amount from invoices where a matching record exists in categories with the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03282
train
v1
Schema: shipments (alias: shp)(id, amount, name, type) staff(value, status, name, date) Task: Select id from shipments where status exists in staff for the same status. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03283
train
v3
Schema: categories (alias: catg)(code, name, date, id) items(code, date, value, type) Task: Find value from categories where amount exceeds the minimum amount from items for the same id. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT MIN(amount) FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03284
train
v2
Schema: requests (alias: ordr)(status, type, value, salary) items(id, code, value, level) Task: Retrieve salary from requests that have at least one corresponding entry in items sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = ordr.level );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03285
train
v1
Schema: staff (alias: empl)(name, amount, code, value) accounts(date, level, id, status) Task: Retrieve code from staff whose status is found in accounts rows where type matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = empl.type );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03286
train
v3
Schema: tasks (alias: tsk)(status, type, name, value) invoices(date, type, salary, status) Task: Retrieve name from tasks with amount above the MIN(value) of invoices rows sharing the same code. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03287
train
v2
Schema: regions (alias: rgn)(status, code, value, name) employees(salary, code, id, name) Task: Find name from regions where a matching record exists in employees with the same code. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03288
train
v1
Schema: projects (alias: prj)(type, amount, code, date) items(value, type, code, name) Task: Find amount from projects where id appears in items entries with matching level. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = prj.level );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03289
train
v3
Schema: products (alias: prod)(amount, name, id, level) items(salary, id, value, code) Task: Retrieve code from products with salary above the AVG(salary) of items rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03290
train
v3
Schema: branches (alias: brc)(name, status, amount, type) regions(value, amount, status, code) Task: Find code from branches where salary exceeds the total value from regions for the same level. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.level = brc.level );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03291
train
v1
Schema: tasks (alias: tsk)(date, salary, level, value) categories(name, salary, value, id) Task: Find id from tasks where code appears in categories entries with matching type. SQL:
SELECT id FROM tasks AS tsk WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03292
train
v1
Schema: customers (alias: cust)(type, code, value, id) sales(level, code, salary, status) Task: Retrieve amount from customers whose id is found in sales rows where code matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = cust.code );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03293
train
v3
Schema: invoices (alias: inv)(name, value, status, id) branches(type, date, amount, status) Task: Retrieve value from invoices with value above the COUNT(amount) of branches rows sharing the same type. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03294
train
v2
Schema: requests (alias: ordr)(type, salary, code, value) orders(level, amount, value, type) Task: Retrieve amount from requests that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03295
train
v1
Schema: categories (alias: catg)(id, name, date, type) managers(salary, type, id, code) Task: Select id from categories where type exists in managers for the same code. SQL:
SELECT id FROM categories AS catg WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.code = catg.code );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03296
train
v3
Schema: items (alias: lne)(status, salary, name, date) transactions(level, date, value, name) Task: Find amount from items where value exceeds the count of salary from transactions for the same level. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03297
train
v1
Schema: customers (alias: cust)(salary, level, status, value) invoices(amount, date, salary, id) Task: Select id from customers where status exists in invoices for the same status. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03298
train
v1
Schema: items (alias: lne)(type, date, amount, name) employees(level, amount, name, id) Task: Find code from items where id appears in employees entries with matching type. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03299
train