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: invoices (alias: inv)(type, level, date, name) accounts(name, code, value, level) Task: Retrieve value from invoices whose id is found in accounts rows where type matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = inv.type );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09000
train
v1
Schema: schedules (alias: schd)(id, code, salary, value) items(level, amount, value, name) Task: Find code from schedules where code appears in items entries with matching status. SQL:
SELECT code FROM schedules AS schd WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09001
train
v2
Schema: invoices (alias: inv)(name, status, amount, value) departments(id, date, name, status) Task: Retrieve id from invoices that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09002
train
v3
Schema: regions (alias: rgn)(code, status, amount, value) shipments(name, date, value, status) Task: Find amount from regions where amount exceeds the total salary from shipments for the same code. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "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_09003
train
v1
Schema: regions (alias: rgn)(id, code, date, name) sales(type, name, id, value) Task: Select name from regions where type exists in sales for the same code. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09004
train
v3
Schema: accounts (alias: acct)(name, type, level, amount) employees(status, date, level, type) Task: Find salary from accounts where amount exceeds the maximum amount from employees for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09005
train
v2
Schema: requests (alias: ordr)(code, type, date, name) sales(date, level, amount, value) Task: Find code from requests where a matching record exists in sales with the same code. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = ordr.code );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09006
train
v3
Schema: orders (alias: ord)(name, amount, status, type) regions(name, type, salary, date) Task: Find name from orders where amount exceeds the average amount from regions for the same id. SQL:
SELECT name FROM orders AS ord WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.id = ord.id );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09007
train
v3
Schema: employees (alias: emp)(level, date, type, name) shipments(name, level, status, type) Task: Find id from employees where value exceeds the total value from shipments for the same type. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09008
train
v2
Schema: branches (alias: brc)(value, id, status, salary) projects(status, amount, id, salary) Task: Retrieve value from branches that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "value", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09009
train
v2
Schema: products (alias: prod)(level, amount, value, status) transactions(value, code, date, type) Task: Retrieve id from products that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = prod.status );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09010
train
v1
Schema: tasks (alias: tsk)(salary, type, status, date) branches(value, name, status, salary) Task: Select id from tasks where status exists in branches for the same status. SQL:
SELECT id FROM tasks AS tsk WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09011
train
v1
Schema: regions (alias: rgn)(date, value, level, amount) shipments(code, type, date, amount) Task: Select salary from regions where code exists in shipments for the same id. SQL:
SELECT salary FROM regions AS rgn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09012
train
v1
Schema: requests (alias: ordr)(date, type, amount, value) items(amount, type, id, salary) Task: Select salary from requests where type exists in items for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = ordr.type );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09013
train
v1
Schema: managers (alias: mgr)(type, code, status, amount) schedules(id, status, type, code) Task: Retrieve amount from managers whose status is found in schedules rows where type matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.type = mgr.type );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09014
train
v3
Schema: employees (alias: emp)(amount, status, value, level) schedules(status, salary, level, amount) Task: Find value from employees where value exceeds the count of amount from schedules for the same id. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = emp.id );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09015
train
v1
Schema: categories (alias: catg)(type, level, value, salary) requests(salary, date, value, type) Task: Select salary from categories where type exists in requests for the same type. SQL:
SELECT salary FROM categories AS catg WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09016
train
v1
Schema: departments (alias: dept)(value, name, date, id) schedules(name, type, status, code) Task: Find code from departments where type appears in schedules entries with matching id. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09017
train
v2
Schema: categories (alias: catg)(salary, code, value, amount) projects(date, value, salary, name) Task: Retrieve salary from categories that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = catg.code );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09018
train
v1
Schema: projects (alias: prj)(value, amount, type, level) tasks(date, type, status, level) Task: Retrieve name from projects whose type is found in tasks rows where type matches the outer record. SQL:
SELECT name FROM projects AS prj WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.type = prj.type );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09019
train
v2
Schema: requests (alias: ordr)(salary, date, status, amount) customers(code, type, date, value) Task: Find amount from requests where a matching record exists in customers with the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ordr.level );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09020
train
v1
Schema: sales (alias: sale)(type, value, id, status) branches(level, type, amount, name) Task: Find value from sales where type appears in branches entries with matching code. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = sale.code );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09021
train
v1
Schema: managers (alias: mgr)(value, code, id, status) regions(value, amount, level, status) Task: Select id from managers where type exists in regions for the same level. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09022
train
v1
Schema: managers (alias: mgr)(id, name, type, code) departments(code, id, salary, status) Task: Find value from managers where level appears in departments entries with matching type. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09023
train
v1
Schema: transactions (alias: txn)(value, amount, date, code) branches(salary, status, date, code) Task: Select code from transactions where status exists in branches for the same level. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09024
train
v2
Schema: transactions (alias: txn)(date, code, value, status) invoices(type, code, status, id) Task: Find name from transactions where a matching record exists in invoices with the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = txn.level );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09025
train
v2
Schema: tasks (alias: tsk)(date, code, amount, id) orders(id, value, level, date) Task: Find value from tasks where a matching record exists in orders with the same id. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09026
train
v1
Schema: categories (alias: catg)(id, name, amount, salary) departments(level, code, name, salary) Task: Retrieve value from categories whose code is found in departments rows where id matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09027
train
v3
Schema: tasks (alias: tsk)(value, level, amount, id) regions(status, name, code, value) Task: Retrieve amount from tasks with salary above the COUNT(value) of regions rows sharing the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09028
train
v3
Schema: accounts (alias: acct)(amount, code, level, value) products(level, amount, value, code) Task: Retrieve id from accounts with amount above the AVG(salary) of products rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09029
train
v3
Schema: transactions (alias: txn)(code, status, salary, name) shipments(level, id, type, date) Task: Retrieve amount from transactions with salary above the SUM(amount) of shipments rows sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09030
train
v2
Schema: customers (alias: cust)(status, id, salary, code) accounts(date, type, value, name) Task: Retrieve salary from customers that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09031
train
v2
Schema: tasks (alias: tsk)(date, status, code, amount) schedules(level, name, status, type) Task: Find id from tasks where a matching record exists in schedules with the same status. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09032
train
v1
Schema: orders (alias: ord)(amount, status, code, value) accounts(date, salary, id, value) Task: Retrieve id from orders whose id is found in accounts rows where level matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.level = ord.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09033
train
v2
Schema: requests (alias: ordr)(amount, salary, value, level) managers(value, name, type, amount) Task: Find code from requests where a matching record exists in managers with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09034
train
v1
Schema: products (alias: prod)(id, status, salary, name) orders(code, status, salary, amount) Task: Retrieve code from products whose type is found in orders rows where level matches the outer record. SQL:
SELECT code FROM products AS prod WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09035
train
v2
Schema: managers (alias: mgr)(amount, value, status, id) staff(amount, value, salary, status) Task: Find name from managers where a matching record exists in staff with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09036
train
v2
Schema: items (alias: lne)(name, amount, date, salary) managers(type, value, id, code) Task: Find salary from items where a matching record exists in managers with the same level. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09037
train
v2
Schema: branches (alias: brc)(code, date, status, amount) employees(name, date, id, code) Task: Find name from branches where a matching record exists in employees with the same level. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = brc.level );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09038
train
v2
Schema: regions (alias: rgn)(id, status, level, date) shipments(code, id, amount, name) Task: Retrieve id from regions that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09039
train
v1
Schema: regions (alias: rgn)(value, status, id, level) departments(status, name, id, salary) Task: Retrieve value from regions whose type is found in departments rows where type matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = rgn.type );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09040
train
v2
Schema: employees (alias: emp)(id, code, level, amount) requests(level, id, code, value) Task: Retrieve name from employees that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = emp.status );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09041
train
v3
Schema: schedules (alias: schd)(code, date, amount, salary) accounts(value, salary, date, status) Task: Find name from schedules where amount exceeds the count of value from accounts for the same type. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09042
train
v3
Schema: items (alias: lne)(id, amount, date, salary) managers(value, type, date, salary) Task: Find salary from items where value exceeds the average value from managers for the same id. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = lne.id );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09043
train
v1
Schema: managers (alias: mgr)(date, name, value, level) sales(level, id, type, date) Task: Find id from managers where level appears in sales entries with matching status. SQL:
SELECT id FROM managers AS mgr WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.status = mgr.status );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09044
train
v1
Schema: items (alias: lne)(type, level, date, name) projects(salary, id, type, amount) Task: Select code from items where code exists in projects for the same code. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = lne.code );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09045
train
v2
Schema: managers (alias: mgr)(type, salary, name, code) categories(type, id, date, salary) Task: Find salary from managers where a matching record exists in categories with the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09046
train
v1
Schema: managers (alias: mgr)(status, date, id, name) products(value, salary, status, level) Task: Select code from managers where type exists in products for the same level. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09047
train
v1
Schema: regions (alias: rgn)(amount, code, date, salary) items(name, salary, id, value) Task: Find name from regions where type appears in items entries with matching code. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09048
train
v3
Schema: products (alias: prod)(name, status, type, code) customers(status, date, value, salary) Task: Retrieve amount from products with salary above the MIN(amount) of customers rows sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09049
train
v3
Schema: transactions (alias: txn)(level, salary, type, status) requests(amount, name, id, value) Task: Retrieve name from transactions with amount above the COUNT(salary) of requests rows sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09050
train
v2
Schema: orders (alias: ord)(type, salary, level, amount) customers(status, value, level, type) Task: Find name from orders where a matching record exists in customers with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ord.level );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09051
train
v3
Schema: managers (alias: mgr)(type, code, id, amount) products(date, type, level, id) Task: Retrieve salary from managers with amount above the AVG(value) of products rows sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT AVG(value) FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09052
train
v3
Schema: transactions (alias: txn)(code, value, level, amount) invoices(date, level, status, code) Task: Retrieve code from transactions with amount above the MAX(amount) of invoices rows sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09053
train
v2
Schema: tasks (alias: tsk)(type, amount, level, name) departments(code, value, type, name) Task: Find amount from tasks where a matching record exists in departments with the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09054
train
v2
Schema: managers (alias: mgr)(type, salary, code, id) transactions(amount, name, date, status) Task: Find salary from managers where a matching record exists in transactions with the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09055
train
v3
Schema: staff (alias: empl)(id, type, salary, level) projects(date, level, amount, value) Task: Retrieve value from staff with salary above the COUNT(salary) of projects rows sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.code = empl.code );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09056
train
v3
Schema: tasks (alias: tsk)(name, id, type, status) transactions(status, code, id, value) Task: Retrieve value from tasks with amount above the MIN(salary) of transactions rows sharing the same code. SQL:
SELECT value FROM tasks AS tsk WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09057
train
v3
Schema: categories (alias: catg)(salary, type, status, value) schedules(code, value, level, type) Task: Find id from categories where amount exceeds the count of salary from schedules for the same code. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09058
train
v1
Schema: customers (alias: cust)(status, level, amount, type) managers(amount, value, id, date) Task: Retrieve name from customers whose status is found in managers rows where type matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09059
train
v1
Schema: staff (alias: empl)(date, id, amount, status) sales(type, code, name, date) Task: Find amount from staff where status appears in sales entries with matching id. SQL:
SELECT amount FROM staff AS empl WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09060
train
v2
Schema: departments (alias: dept)(date, id, status, salary) products(date, amount, salary, value) Task: Retrieve amount from departments that have at least one corresponding entry in products sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = dept.level );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09061
train
v1
Schema: staff (alias: empl)(salary, type, amount, value) employees(id, level, value, status) Task: Find amount from staff where code appears in employees entries with matching type. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09062
train
v1
Schema: requests (alias: ordr)(value, date, salary, status) transactions(id, salary, type, name) Task: Find code from requests where id appears in transactions entries with matching id. SQL:
SELECT code FROM requests AS ordr WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09063
train
v3
Schema: invoices (alias: inv)(amount, level, type, status) managers(type, status, name, code) Task: Find id from invoices where value exceeds the total amount from managers for the same type. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09064
train
v2
Schema: employees (alias: emp)(id, value, amount, status) customers(type, date, code, salary) Task: Retrieve name from employees that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09065
train
v1
Schema: customers (alias: cust)(type, value, id, date) employees(code, type, level, amount) Task: Retrieve value from customers whose level is found in employees rows where type matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.type = cust.type );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09066
train
v1
Schema: invoices (alias: inv)(salary, status, level, name) shipments(date, id, status, salary) Task: Find id from invoices where status appears in shipments entries with matching id. SQL:
SELECT id FROM invoices AS inv WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09067
train
v1
Schema: staff (alias: empl)(name, id, salary, level) requests(level, date, status, salary) Task: Find code from staff where type appears in requests entries with matching code. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09068
train
v3
Schema: schedules (alias: schd)(name, value, salary, id) invoices(id, salary, name, type) Task: Find salary from schedules where amount exceeds the total value from invoices for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09069
train
v1
Schema: employees (alias: emp)(value, amount, salary, name) requests(date, name, level, salary) Task: Retrieve amount from employees whose code is found in requests rows where type matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09070
train
v1
Schema: regions (alias: rgn)(name, date, status, code) customers(type, salary, status, code) Task: Retrieve salary from regions whose level is found in customers rows where id matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = rgn.id );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09071
train
v3
Schema: customers (alias: cust)(amount, type, value, date) managers(value, date, code, level) Task: Retrieve name from customers with amount above the MIN(value) of managers rows sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09072
train
v2
Schema: managers (alias: mgr)(salary, name, date, level) categories(code, id, level, date) Task: Retrieve amount from managers that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09073
train
v2
Schema: customers (alias: cust)(status, value, amount, id) managers(amount, status, value, name) Task: Find salary from customers where a matching record exists in managers with the same id. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "salary", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09074
train
v3
Schema: requests (alias: ordr)(value, id, salary, date) items(id, code, level, amount) Task: Find salary from requests where salary exceeds the minimum value from items for the same id. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.id = ordr.id );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09075
train
v1
Schema: accounts (alias: acct)(amount, date, value, id) employees(value, id, salary, amount) Task: Find name from accounts where code appears in employees entries with matching status. SQL:
SELECT name FROM accounts AS acct WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09076
train
v2
Schema: branches (alias: brc)(date, type, code, name) projects(amount, date, id, name) Task: Retrieve name from branches that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = brc.type );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09077
train
v3
Schema: staff (alias: empl)(value, code, id, name) shipments(status, amount, level, value) Task: Retrieve amount from staff with salary above the MAX(amount) of shipments rows sharing the same type. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09078
train
v3
Schema: departments (alias: dept)(level, date, code, status) projects(id, type, salary, date) Task: Retrieve id from departments with amount above the AVG(value) of projects rows sharing the same id. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT AVG(value) FROM projects AS prj WHERE prj.id = dept.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09079
train
v3
Schema: managers (alias: mgr)(code, value, level, name) invoices(name, salary, amount, id) Task: Retrieve code from managers with value above the AVG(salary) of invoices rows sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.id = mgr.id );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09080
train
v3
Schema: managers (alias: mgr)(salary, date, status, code) staff(type, value, salary, status) Task: Find value from managers where salary exceeds the minimum value from staff for the same type. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09081
train
v3
Schema: branches (alias: brc)(code, id, status, amount) employees(salary, name, type, level) Task: Find code from branches where salary exceeds the average value from employees for the same status. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.status = brc.status );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09082
train
v1
Schema: regions (alias: rgn)(type, salary, date, status) accounts(type, level, salary, amount) Task: Find salary from regions where status appears in accounts entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09083
train
v1
Schema: regions (alias: rgn)(level, id, amount, date) customers(status, code, id, name) Task: Find name from regions where status appears in customers entries with matching code. SQL:
SELECT name FROM regions AS rgn WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09084
train
v3
Schema: shipments (alias: shp)(salary, amount, type, name) categories(status, type, id, level) Task: Retrieve amount from shipments with value above the MAX(value) of categories rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MAX(value) FROM categories AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09085
train
v2
Schema: tasks (alias: tsk)(level, status, type, date) staff(code, level, value, salary) Task: Retrieve salary from tasks that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09086
train
v3
Schema: schedules (alias: schd)(type, status, salary, value) sales(salary, amount, code, status) Task: Find id from schedules where value exceeds the average amount from sales for the same id. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.id = schd.id );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09087
train
v3
Schema: transactions (alias: txn)(level, id, code, status) categories(value, type, id, level) Task: Retrieve code from transactions with salary above the COUNT(value) of categories rows sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09088
train
v3
Schema: schedules (alias: schd)(date, name, status, value) products(type, value, status, amount) Task: Find name from schedules where salary exceeds the average amount from products for the same id. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT AVG(amount) FROM products AS prod WHERE prod.id = schd.id );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09089
train
v1
Schema: staff (alias: empl)(code, amount, value, date) projects(salary, amount, name, date) Task: Select code from staff where type exists in projects for the same status. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09090
train
v1
Schema: products (alias: prod)(level, code, amount, id) branches(type, code, level, date) Task: Retrieve salary from products whose id is found in branches rows where status matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09091
train
v3
Schema: staff (alias: empl)(type, date, id, amount) schedules(code, level, name, amount) Task: Find name from staff where salary exceeds the count of value from schedules for the same type. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09092
train
v2
Schema: schedules (alias: schd)(code, amount, date, type) sales(status, id, amount, code) Task: Retrieve code from schedules that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09093
train
v3
Schema: departments (alias: dept)(type, level, code, id) categories(amount, code, level, id) Task: Find id from departments where amount exceeds the average salary from categories for the same type. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.type = dept.type );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09094
train
v3
Schema: regions (alias: rgn)(value, status, name, amount) projects(id, salary, date, status) Task: Find id from regions where salary exceeds the average value from projects for the same type. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT AVG(value) FROM projects AS prj WHERE prj.type = rgn.type );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09095
train
v2
Schema: tasks (alias: tsk)(type, value, code, salary) regions(name, amount, date, salary) Task: Find value from tasks where a matching record exists in regions with the same type. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "value", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09096
train
v3
Schema: products (alias: prod)(code, status, level, type) accounts(type, name, amount, date) Task: Find amount from products where amount exceeds the minimum value from accounts for the same id. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09097
train
v1
Schema: invoices (alias: inv)(code, date, type, name) sales(salary, date, amount, status) Task: Select name from invoices where code exists in sales for the same level. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = inv.level );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09098
train
v2
Schema: managers (alias: mgr)(level, date, type, code) employees(level, salary, id, code) Task: Retrieve id from managers that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09099
train