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
v1
Schema: tasks (alias: tsk)(status, amount, id, date) regions(code, name, id, value) Task: Find amount from tasks where status appears in regions entries with matching code. SQL:
SELECT amount FROM tasks AS tsk WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07300
train
v2
Schema: categories (alias: catg)(amount, date, level, name) accounts(level, id, code, amount) Task: Retrieve id from categories that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07301
train
v2
Schema: schedules (alias: schd)(name, code, date, value) departments(id, salary, date, code) Task: Find name from schedules where a matching record exists in departments with the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07302
train
v3
Schema: regions (alias: rgn)(status, salary, level, value) shipments(id, value, salary, status) Task: Find value from regions where amount exceeds the count of salary from shipments for the same id. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07303
train
v2
Schema: regions (alias: rgn)(date, id, level, name) branches(id, value, amount, code) Task: Find name from regions where a matching record exists in branches with the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = rgn.type );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07304
train
v1
Schema: projects (alias: prj)(level, value, name, status) categories(salary, id, level, amount) Task: Retrieve value from projects whose type is found in categories rows where type matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07305
train
v3
Schema: customers (alias: cust)(type, amount, id, name) regions(type, date, status, code) Task: Find name from customers where value exceeds the maximum salary from regions for the same level. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07306
train
v3
Schema: categories (alias: catg)(amount, id, level, status) schedules(status, id, value, level) Task: Find id from categories where amount exceeds the maximum salary from schedules for the same level. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07307
train
v1
Schema: sales (alias: sale)(value, code, amount, id) requests(salary, level, id, name) Task: Select code from sales where level exists in requests for the same type. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07308
train
v3
Schema: staff (alias: empl)(id, date, value, code) projects(name, id, type, level) Task: Retrieve amount from staff with amount above the AVG(value) of projects rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM projects AS prj WHERE prj.level = empl.level );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07309
train
v1
Schema: staff (alias: empl)(date, status, amount, salary) regions(date, status, id, type) Task: Find amount from staff where code appears in regions entries with matching id. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07310
train
v2
Schema: products (alias: prod)(type, status, salary, amount) requests(salary, type, amount, code) Task: Find id from products where a matching record exists in requests with the same id. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = prod.id );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07311
train
v2
Schema: departments (alias: dept)(value, name, status, level) branches(status, value, name, salary) Task: Find code from departments where a matching record exists in branches with the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07312
train
v3
Schema: regions (alias: rgn)(status, salary, code, date) employees(name, status, date, value) Task: Retrieve id from regions with amount above the SUM(salary) of employees rows sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07313
train
v3
Schema: requests (alias: ordr)(id, salary, type, level) orders(code, name, amount, date) Task: Retrieve code from requests with value above the SUM(amount) of orders rows sharing the same id. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07314
train
v3
Schema: branches (alias: brc)(salary, status, type, id) regions(name, id, value, status) Task: Find value from branches where value exceeds the count of salary from regions for the same type. SQL:
SELECT value FROM branches AS brc WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = brc.type );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07315
train
v3
Schema: products (alias: prod)(name, amount, status, value) shipments(status, value, date, amount) Task: Find id from products where salary exceeds the minimum salary from shipments for the same status. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07316
train
v2
Schema: branches (alias: brc)(level, id, value, name) tasks(value, salary, date, type) Task: Find value from branches where a matching record exists in tasks with the same type. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = brc.type );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "value", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07317
train
v3
Schema: staff (alias: empl)(salary, type, level, status) accounts(status, date, name, value) Task: Retrieve value from staff with salary above the MAX(salary) of accounts rows sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07318
train
v1
Schema: staff (alias: empl)(status, value, id, level) customers(code, amount, id, type) Task: Retrieve id from staff whose code is found in customers rows where type matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07319
train
v3
Schema: schedules (alias: schd)(code, date, type, level) tasks(code, amount, name, value) Task: Retrieve code from schedules with salary above the COUNT(amount) of tasks rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.status = schd.status );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07320
train
v1
Schema: categories (alias: catg)(salary, type, amount, level) employees(name, amount, status, level) Task: Retrieve name from categories whose code is found in employees rows where id matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07321
train
v3
Schema: tasks (alias: tsk)(value, name, id, salary) sales(name, date, code, level) Task: Retrieve id from tasks with amount above the SUM(salary) of sales rows sharing the same id. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07322
train
v2
Schema: departments (alias: dept)(date, id, amount, status) branches(value, date, id, name) Task: Retrieve name from departments that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07323
train
v3
Schema: categories (alias: catg)(name, date, id, code) invoices(date, name, type, code) Task: Retrieve code from categories with amount above the MAX(value) of invoices rows sharing the same status. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.status = catg.status );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07324
train
v2
Schema: orders (alias: ord)(type, date, name, value) items(name, date, type, code) Task: Find amount from orders where a matching record exists in items with the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07325
train
v2
Schema: tasks (alias: tsk)(type, name, id, salary) managers(status, type, level, code) Task: Retrieve id from tasks that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07326
train
v1
Schema: transactions (alias: txn)(id, level, date, code) managers(level, salary, type, name) Task: Select name from transactions where level exists in managers for the same id. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07327
train
v2
Schema: invoices (alias: inv)(date, status, amount, name) tasks(salary, value, date, level) Task: Find code from invoices where a matching record exists in tasks with the same status. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = inv.status );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07328
train
v2
Schema: transactions (alias: txn)(status, value, name, salary) branches(salary, type, date, amount) Task: Find id from transactions where a matching record exists in branches with the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07329
train
v3
Schema: requests (alias: ordr)(status, date, salary, code) accounts(date, code, id, value) Task: Retrieve amount from requests with value above the AVG(amount) of accounts rows sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07330
train
v3
Schema: invoices (alias: inv)(value, salary, name, level) staff(salary, code, id, level) Task: Retrieve amount from invoices with amount above the SUM(amount) of staff rows sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07331
train
v1
Schema: managers (alias: mgr)(type, value, level, salary) branches(salary, amount, status, date) Task: Select value from managers where status exists in branches for the same type. SQL:
SELECT value FROM managers AS mgr WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07332
train
v3
Schema: staff (alias: empl)(code, type, amount, name) transactions(name, date, type, id) Task: Retrieve id from staff with amount above the SUM(salary) of transactions rows sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07333
train
v3
Schema: sales (alias: sale)(salary, value, code, date) requests(value, code, level, amount) Task: Retrieve salary from sales with salary above the COUNT(salary) of requests rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.status = sale.status );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07334
train
v3
Schema: customers (alias: cust)(name, amount, code, level) departments(type, id, salary, name) Task: Find salary from customers where salary exceeds the minimum amount from departments for the same id. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.id = cust.id );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07335
train
v2
Schema: products (alias: prod)(amount, code, level, salary) orders(salary, id, value, name) Task: Retrieve name from products that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07336
train
v2
Schema: employees (alias: emp)(id, code, amount, date) transactions(salary, amount, status, value) Task: Find id from employees where a matching record exists in transactions with the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07337
train
v3
Schema: transactions (alias: txn)(amount, code, date, id) branches(type, level, value, status) Task: Retrieve id from transactions with value above the COUNT(value) of branches rows sharing the same level. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07338
train
v2
Schema: accounts (alias: acct)(salary, type, date, amount) staff(level, value, status, code) Task: Find name from accounts where a matching record exists in staff with the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07339
train
v2
Schema: schedules (alias: schd)(level, salary, id, code) categories(salary, name, status, value) Task: Retrieve code from schedules that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07340
train
v3
Schema: regions (alias: rgn)(status, type, id, code) departments(amount, value, code, level) Task: Retrieve value from regions with amount above the AVG(amount) of departments rows sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.status = rgn.status );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07341
train
v1
Schema: invoices (alias: inv)(amount, status, id, code) transactions(date, level, id, amount) Task: Select value from invoices where code exists in transactions for the same type. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07342
train
v2
Schema: branches (alias: brc)(date, status, type, level) customers(code, level, value, salary) Task: Find salary from branches where a matching record exists in customers with the same type. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07343
train
v2
Schema: branches (alias: brc)(date, value, type, amount) products(value, code, id, level) Task: Find value from branches where a matching record exists in products with the same level. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = brc.level );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07344
train
v3
Schema: orders (alias: ord)(code, type, name, amount) customers(amount, value, salary, date) Task: Find id from orders where amount exceeds the minimum amount from customers for the same id. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07345
train
v2
Schema: departments (alias: dept)(level, id, code, salary) branches(code, level, value, id) Task: Find amount from departments where a matching record exists in branches with the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = dept.id );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07346
train
v3
Schema: tasks (alias: tsk)(code, value, id, type) orders(level, salary, value, type) Task: Find name from tasks where value exceeds the total value from orders for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT SUM(value) FROM orders AS ord WHERE ord.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07347
train
v3
Schema: employees (alias: emp)(date, id, salary, type) items(name, id, date, status) Task: Retrieve amount from employees with value above the MAX(value) of items rows sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT MAX(value) FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07348
train
v3
Schema: regions (alias: rgn)(salary, value, code, date) products(name, value, id, status) Task: Find amount from regions where salary exceeds the average salary from products for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT AVG(salary) FROM products AS prod WHERE prod.id = rgn.id );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07349
train
v1
Schema: managers (alias: mgr)(level, salary, date, code) regions(status, name, value, type) Task: Find amount from managers where code appears in regions entries with matching status. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07350
train
v1
Schema: products (alias: prod)(name, code, status, date) projects(name, status, level, date) Task: Select amount from products where id exists in projects for the same status. SQL:
SELECT amount FROM products AS prod WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.status = prod.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07351
train
v3
Schema: projects (alias: prj)(amount, level, date, id) items(value, amount, type, salary) Task: Retrieve salary from projects with amount above the MIN(salary) of items rows sharing the same id. SQL:
SELECT salary FROM projects AS prj WHERE amount > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07352
train
v3
Schema: staff (alias: empl)(date, name, code, level) sales(id, date, level, name) Task: Retrieve id from staff with salary above the SUM(salary) of sales rows sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07353
train
v2
Schema: products (alias: prod)(type, value, status, id) staff(level, date, salary, amount) Task: Find amount from products where a matching record exists in staff with the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07354
train
v2
Schema: items (alias: lne)(name, amount, id, level) schedules(salary, code, name, value) Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07355
train
v2
Schema: shipments (alias: shp)(value, name, id, date) employees(amount, date, salary, status) Task: Retrieve amount from shipments that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07356
train
v2
Schema: orders (alias: ord)(code, date, salary, status) employees(value, name, code, date) 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_07357
train
v3
Schema: departments (alias: dept)(code, salary, value, status) orders(status, type, id, amount) Task: Find id from departments where salary exceeds the total salary from orders for the same id. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = dept.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07358
train
v2
Schema: branches (alias: brc)(status, date, salary, name) customers(value, date, amount, id) Task: Find salary from branches where a matching record exists in customers with the same status. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = brc.status );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07359
train
v3
Schema: accounts (alias: acct)(name, value, id, salary) departments(code, type, status, level) Task: Find code from accounts where salary exceeds the total value from departments for the same level. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT SUM(value) FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07360
train
v2
Schema: products (alias: prod)(date, amount, salary, code) branches(level, name, type, date) Task: Retrieve value from products that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT value 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": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07361
train
v2
Schema: employees (alias: emp)(type, level, salary, status) accounts(code, status, id, level) Task: Retrieve id from employees that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07362
train
v1
Schema: requests (alias: ordr)(type, salary, id, status) categories(amount, id, value, date) Task: Select code from requests where code exists in categories for the same level. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07363
train
v2
Schema: departments (alias: dept)(date, name, value, type) products(value, date, name, id) Task: Find value from departments where a matching record exists in products with the same type. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07364
train
v1
Schema: items (alias: lne)(salary, id, name, date) requests(value, status, id, code) Task: Find id from items where level appears in requests entries with matching type. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = lne.type );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07365
train
v1
Schema: invoices (alias: inv)(level, salary, value, amount) orders(status, salary, value, level) Task: Select amount from invoices where status exists in orders for the same status. SQL:
SELECT amount 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": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07366
train
v2
Schema: schedules (alias: schd)(code, amount, status, date) transactions(status, value, id, name) Task: Find amount from schedules where a matching record exists in transactions with the same id. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07367
train
v1
Schema: accounts (alias: acct)(date, status, type, salary) departments(name, type, value, code) Task: Select amount from accounts where level exists in departments for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07368
train
v1
Schema: shipments (alias: shp)(status, salary, amount, value) schedules(salary, name, level, value) Task: Retrieve amount from shipments whose code is found in schedules rows where type matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07369
train
v2
Schema: products (alias: prod)(type, value, code, amount) regions(name, code, date, status) Task: Retrieve code from products that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07370
train
v2
Schema: accounts (alias: acct)(name, id, salary, code) customers(type, salary, status, name) Task: Find name from accounts where a matching record exists in customers with the same level. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = acct.level );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07371
train
v2
Schema: transactions (alias: txn)(status, id, name, type) products(date, status, salary, type) Task: Retrieve value from transactions that have at least one corresponding entry in products sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07372
train
v3
Schema: regions (alias: rgn)(value, amount, type, salary) invoices(id, name, date, code) Task: Retrieve amount from regions with amount above the SUM(salary) of invoices rows sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.code = rgn.code );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07373
train
v3
Schema: sales (alias: sale)(amount, id, level, name) projects(id, code, amount, salary) Task: Retrieve amount from sales with amount above the MAX(value) of projects rows sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT MAX(value) FROM projects AS prj WHERE prj.code = sale.code );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07374
train
v2
Schema: employees (alias: emp)(status, code, name, value) branches(date, value, type, status) Task: Find name from employees where a matching record exists in branches with the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = emp.status );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07375
train
v3
Schema: invoices (alias: inv)(level, status, code, amount) items(status, name, type, level) Task: Find value from invoices where value exceeds the average value from items for the same type. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07376
train
v1
Schema: regions (alias: rgn)(value, level, amount, date) managers(level, amount, id, name) Task: Retrieve value from regions whose status is found in managers rows where status matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07377
train
v2
Schema: requests (alias: ordr)(amount, date, code, value) branches(name, level, amount, status) Task: Find value from requests where a matching record exists in branches with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = ordr.level );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07378
train
v2
Schema: requests (alias: ordr)(level, status, name, amount) sales(value, type, amount, id) Task: Find id from requests where a matching record exists in sales with the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07379
train
v3
Schema: accounts (alias: acct)(code, amount, date, value) regions(date, salary, type, name) Task: Retrieve code from accounts with salary above the AVG(value) of regions rows sharing the same level. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07380
train
v1
Schema: customers (alias: cust)(date, type, salary, code) schedules(amount, status, code, value) Task: Retrieve salary from customers whose status is found in schedules rows where id matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = cust.id );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07381
train
v3
Schema: categories (alias: catg)(id, amount, name, salary) items(code, level, value, id) Task: Retrieve name from categories with salary above the AVG(amount) of items rows sharing the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07382
train
v3
Schema: branches (alias: brc)(salary, status, type, amount) orders(status, name, code, id) Task: Retrieve amount from branches with value above the COUNT(salary) of orders rows sharing the same status. SQL:
SELECT amount FROM branches AS brc WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.status = brc.status );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07383
train
v1
Schema: regions (alias: rgn)(salary, value, code, type) accounts(value, id, code, salary) Task: Find amount from regions where level appears in accounts entries with matching type. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = rgn.type );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07384
train
v1
Schema: items (alias: lne)(level, value, id, name) requests(name, code, date, id) Task: Retrieve salary from items whose code is found in requests rows where status matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07385
train
v3
Schema: staff (alias: empl)(value, id, date, status) shipments(code, salary, amount, level) Task: Retrieve id from staff with value above the AVG(salary) of shipments rows sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07386
train
v1
Schema: items (alias: lne)(id, amount, date, value) requests(amount, status, salary, name) Task: Select name from items where type exists in requests for the same status. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07387
train
v1
Schema: sales (alias: sale)(status, value, amount, code) transactions(value, code, status, name) Task: Retrieve value from sales whose status is found in transactions rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07388
train
v1
Schema: regions (alias: rgn)(code, date, salary, name) items(value, status, code, name) Task: Find id from regions where code appears in items entries with matching id. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = rgn.id );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07389
train
v3
Schema: requests (alias: ordr)(name, date, level, code) customers(status, amount, type, value) Task: Retrieve amount from requests with value above the MIN(salary) of customers rows sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07390
train
v3
Schema: managers (alias: mgr)(name, amount, level, status) customers(name, amount, status, code) Task: Retrieve id from managers with amount above the AVG(value) of customers rows sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07391
train
v2
Schema: orders (alias: ord)(type, level, amount, name) requests(salary, value, level, id) Task: Retrieve salary from orders that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = ord.id );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07392
train
v1
Schema: projects (alias: prj)(salary, name, type, date) invoices(amount, status, name, value) Task: Select name from projects where level exists in invoices for the same code. SQL:
SELECT name FROM projects AS prj WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.code = prj.code );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07393
train
v2
Schema: departments (alias: dept)(date, amount, type, level) accounts(type, status, id, level) Task: Find id from departments where a matching record exists in accounts with the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07394
train
v2
Schema: projects (alias: prj)(value, salary, type, id) items(salary, id, date, value) Task: Retrieve name from projects that have at least one corresponding entry in items sharing the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07395
train
v3
Schema: departments (alias: dept)(type, code, amount, id) orders(level, salary, date, value) Task: Retrieve code from departments with value above the COUNT(amount) of orders rows sharing the same id. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.id = dept.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07396
train
v2
Schema: staff (alias: empl)(type, id, salary, status) regions(status, date, type, value) Task: Find name from staff where a matching record exists in regions with the same id. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "name", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07397
train
v3
Schema: regions (alias: rgn)(type, status, name, salary) branches(type, amount, status, date) Task: Find code from regions where salary exceeds the total salary from branches for the same status. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07398
train
v3
Schema: regions (alias: rgn)(value, level, type, date) shipments(name, amount, date, id) Task: Retrieve name from regions with salary above the MIN(value) of shipments rows sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07399
train