variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: sales (alias: sale)(level, id, salary, amount) schedules(name, type, amount, salary) Task: Retrieve code from sales that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03800
train
v2
Schema: sales (alias: sale)(salary, amount, type, date) requests(amount, date, type, level) Task: Retrieve amount from sales that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = sale.id );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03801
train
v1
Schema: managers (alias: mgr)(salary, type, name, value) orders(value, status, id, level) Task: Select value from managers where status exists in orders for the same code. SQL:
SELECT value FROM managers AS mgr WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = mgr.code );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03802
train
v2
Schema: regions (alias: rgn)(code, type, name, salary) customers(status, salary, date, value) Task: Retrieve code from regions that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03803
train
v3
Schema: departments (alias: dept)(salary, status, level, id) employees(id, salary, code, value) Task: Retrieve salary from departments with salary above the SUM(value) of employees rows sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT SUM(value) FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03804
train
v3
Schema: items (alias: lne)(status, id, code, date) invoices(amount, date, code, status) Task: Retrieve id from items with value above the AVG(salary) of invoices rows sharing the same type. SQL:
SELECT id FROM items AS lne WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.type = lne.type );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03805
train
v3
Schema: requests (alias: ordr)(code, type, amount, name) invoices(type, value, id, status) Task: Retrieve value from requests with amount above the AVG(salary) of invoices rows sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03806
train
v1
Schema: requests (alias: ordr)(amount, id, name, date) shipments(level, name, amount, value) Task: Retrieve amount from requests whose id is found in shipments rows where id matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03807
train
v1
Schema: transactions (alias: txn)(type, code, date, value) departments(value, level, status, code) Task: Select id from transactions where type exists in departments for the same type. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = txn.type );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03808
train
v2
Schema: projects (alias: prj)(value, id, salary, date) requests(salary, level, name, value) Task: Retrieve code from projects that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = prj.id );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03809
train
v3
Schema: accounts (alias: acct)(date, level, value, salary) requests(date, salary, status, value) Task: Find code from accounts where amount exceeds the maximum value from requests for the same status. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03810
train
v2
Schema: invoices (alias: inv)(type, id, level, status) products(code, value, status, name) Task: Find code from invoices where a matching record exists in products with the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03811
train
v1
Schema: accounts (alias: acct)(date, salary, id, level) managers(name, status, code, salary) Task: Find amount from accounts where code appears in managers entries with matching code. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03812
train
v3
Schema: staff (alias: empl)(status, date, amount, name) shipments(id, status, level, amount) Task: Retrieve amount from staff with salary above the MAX(value) of shipments rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03813
train
v3
Schema: transactions (alias: txn)(name, salary, value, type) staff(type, salary, value, level) Task: Find amount from transactions where salary exceeds the maximum amount from staff for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.status = txn.status );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03814
train
v1
Schema: shipments (alias: shp)(code, level, status, salary) employees(id, salary, date, level) Task: Select salary from shipments where type exists in employees for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03815
train
v3
Schema: regions (alias: rgn)(value, level, amount, name) departments(salary, level, date, amount) Task: Retrieve id from regions with value above the MIN(value) of departments rows sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT MIN(value) FROM departments AS dept WHERE dept.status = rgn.status );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03816
train
v3
Schema: transactions (alias: txn)(type, date, name, status) shipments(date, level, status, value) Task: Retrieve value from transactions with amount above the MAX(salary) of shipments rows sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03817
train
v2
Schema: employees (alias: emp)(status, name, type, amount) branches(id, type, name, amount) Task: Retrieve code from employees that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = emp.type );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03818
train
v2
Schema: sales (alias: sale)(type, salary, status, value) transactions(name, type, status, amount) Task: Retrieve code from sales that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03819
train
v1
Schema: branches (alias: brc)(id, salary, level, code) schedules(date, name, value, salary) Task: Retrieve id from branches whose id is found in schedules rows where type matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = brc.type );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03820
train
v1
Schema: managers (alias: mgr)(amount, salary, value, name) sales(type, status, salary, code) Task: Retrieve salary from managers whose status is found in sales rows where level matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03821
train
v2
Schema: invoices (alias: inv)(value, salary, date, name) categories(code, status, type, id) Task: Find code from invoices where a matching record exists in categories with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03822
train
v1
Schema: invoices (alias: inv)(code, value, type, salary) categories(level, date, code, type) Task: Select salary from invoices where level exists in categories for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03823
train
v1
Schema: shipments (alias: shp)(code, amount, level, date) departments(name, status, code, id) Task: Find salary from shipments where id appears in departments entries with matching id. SQL:
SELECT salary FROM shipments AS shp WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = shp.id );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03824
train
v1
Schema: shipments (alias: shp)(value, name, status, salary) employees(salary, date, code, status) Task: Find id from shipments where status appears in employees entries with matching type. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03825
train
v3
Schema: invoices (alias: inv)(type, level, status, date) requests(status, name, level, salary) Task: Find name from invoices where amount exceeds the average amount from requests for the same id. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03826
train
v3
Schema: items (alias: lne)(amount, name, id, date) employees(amount, code, value, date) Task: Find id from items where amount exceeds the total salary from employees for the same level. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.level = lne.level );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03827
train
v1
Schema: orders (alias: ord)(name, amount, salary, status) projects(code, level, name, status) Task: Retrieve id from orders whose level is found in projects rows where type matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = ord.type );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03828
train
v2
Schema: invoices (alias: inv)(name, status, amount, type) sales(status, salary, type, date) Task: Retrieve code from invoices that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03829
train
v2
Schema: products (alias: prod)(level, salary, name, value) categories(status, type, name, date) Task: Find salary from products where a matching record exists in categories with the same code. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03830
train
v2
Schema: accounts (alias: acct)(code, salary, amount, name) projects(status, type, salary, name) Task: Find id from accounts where a matching record exists in projects with the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03831
train
v1
Schema: staff (alias: empl)(status, value, amount, level) products(code, id, name, status) Task: Select salary from staff where code exists in products for the same level. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03832
train
v3
Schema: orders (alias: ord)(name, type, code, amount) departments(date, status, salary, value) Task: Retrieve code from orders with salary above the MIN(salary) of departments rows sharing the same code. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.code = ord.code );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03833
train
v3
Schema: schedules (alias: schd)(type, id, date, code) shipments(salary, amount, code, type) Task: Retrieve amount from schedules with value above the MAX(value) of shipments rows sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03834
train
v2
Schema: requests (alias: ordr)(code, amount, id, status) departments(salary, date, amount, code) Task: Retrieve code from requests that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03835
train
v1
Schema: categories (alias: catg)(level, date, value, name) customers(value, date, type, code) Task: Find code from categories where type appears in customers entries with matching level. SQL:
SELECT code FROM categories AS catg WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03836
train
v2
Schema: shipments (alias: shp)(id, salary, status, date) sales(date, name, code, salary) Task: Retrieve amount from shipments that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03837
train
v1
Schema: customers (alias: cust)(name, status, level, code) requests(value, salary, amount, status) Task: Retrieve name from customers whose level is found in requests rows where level matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03838
train
v2
Schema: departments (alias: dept)(value, status, date, salary) staff(code, value, salary, name) Task: Retrieve amount from departments that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03839
train
v3
Schema: departments (alias: dept)(value, type, name, id) invoices(amount, status, value, name) Task: Retrieve salary from departments with amount above the COUNT(amount) of invoices rows sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03840
train
v2
Schema: regions (alias: rgn)(type, name, date, value) schedules(type, amount, level, value) Task: Retrieve value from regions that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03841
train
v3
Schema: items (alias: lne)(date, name, code, type) projects(value, code, level, amount) Task: Find value from items where salary exceeds the count of amount from projects for the same status. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.status = lne.status );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03842
train
v3
Schema: products (alias: prod)(date, value, status, type) invoices(salary, code, status, amount) Task: Retrieve code from products with value above the MAX(value) of invoices rows sharing the same level. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03843
train
v3
Schema: invoices (alias: inv)(amount, date, status, value) products(salary, code, date, status) Task: Find amount from invoices where amount exceeds the total value from products for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT SUM(value) FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03844
train
v1
Schema: branches (alias: brc)(amount, code, date, status) managers(value, date, id, salary) Task: Select id from branches where id exists in managers for the same status. SQL:
SELECT id FROM branches AS brc WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = brc.status );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03845
train
v2
Schema: employees (alias: emp)(id, type, value, level) accounts(level, date, type, id) Task: Retrieve salary from employees that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary 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": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03846
train
v1
Schema: tasks (alias: tsk)(amount, id, value, type) departments(code, date, name, type) Task: Select amount from tasks where level exists in departments for the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03847
train
v2
Schema: transactions (alias: txn)(name, amount, level, date) accounts(salary, name, amount, value) Task: Retrieve amount from transactions that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03848
train
v2
Schema: invoices (alias: inv)(level, salary, type, id) projects(value, level, type, name) Task: Find value from invoices where a matching record exists in projects with the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = inv.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03849
train
v1
Schema: customers (alias: cust)(status, amount, name, type) branches(value, type, date, level) Task: Select salary from customers where status exists in branches for the same code. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.code = cust.code );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03850
train
v2
Schema: projects (alias: prj)(value, status, code, date) shipments(type, id, value, amount) Task: Find code from projects where a matching record exists in shipments with the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = prj.level );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03851
train
v2
Schema: items (alias: lne)(name, status, type, code) categories(amount, code, id, status) Task: Find code from items where a matching record exists in categories with the same type. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = lne.type );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03852
train
v3
Schema: orders (alias: ord)(status, type, amount, date) categories(amount, type, code, value) Task: Find amount from orders where salary exceeds the average value from categories for the same type. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT AVG(value) FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03853
train
v2
Schema: items (alias: lne)(amount, name, level, id) customers(status, name, date, level) Task: Find salary from items where a matching record exists in customers with the same level. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = lne.level );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03854
train
v2
Schema: branches (alias: brc)(type, status, id, amount) departments(type, status, amount, value) Task: Retrieve salary from branches that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = brc.type );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "salary", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03855
train
v2
Schema: customers (alias: cust)(code, date, id, amount) requests(date, amount, status, type) Task: Retrieve code from customers that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03856
train
v1
Schema: shipments (alias: shp)(id, type, name, amount) sales(name, amount, date, value) Task: Find value from shipments where code appears in sales entries with matching status. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.status = shp.status );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03857
train
v2
Schema: products (alias: prod)(value, status, type, code) transactions(date, salary, status, amount) Task: Retrieve value from products that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03858
train
v3
Schema: tasks (alias: tsk)(type, date, amount, status) projects(amount, salary, code, level) Task: Retrieve code from tasks with amount above the MIN(salary) of projects rows sharing the same level. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03859
train
v1
Schema: tasks (alias: tsk)(date, amount, level, code) departments(amount, status, id, type) Task: Retrieve amount from tasks whose status is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03860
train
v2
Schema: staff (alias: empl)(id, amount, name, value) departments(type, code, salary, id) Task: Retrieve amount from staff that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = empl.id );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03861
train
v3
Schema: orders (alias: ord)(salary, level, amount, name) branches(level, amount, salary, code) Task: Retrieve amount from orders with salary above the MIN(salary) of branches rows sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.type = ord.type );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03862
train
v1
Schema: items (alias: lne)(code, amount, name, value) invoices(id, status, name, code) Task: Find name from items where type appears in invoices entries with matching code. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03863
train
v2
Schema: customers (alias: cust)(level, id, name, status) invoices(salary, name, level, amount) Task: Retrieve code from customers that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03864
train
v3
Schema: customers (alias: cust)(code, value, type, id) branches(value, code, type, status) Task: Retrieve amount from customers with salary above the MIN(value) of branches rows sharing the same id. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT MIN(value) FROM branches AS brc WHERE brc.id = cust.id );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03865
train
v2
Schema: branches (alias: brc)(id, type, amount, date) shipments(id, level, name, date) Task: Retrieve name from branches that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = brc.id );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03866
train
v2
Schema: accounts (alias: acct)(value, name, amount, id) tasks(salary, type, amount, name) Task: Find salary from accounts where a matching record exists in tasks with the same status. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = acct.status );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03867
train
v3
Schema: accounts (alias: acct)(id, date, value, amount) transactions(level, value, amount, status) Task: Find id from accounts where value exceeds the minimum value from transactions for the same status. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03868
train
v3
Schema: categories (alias: catg)(level, status, name, date) sales(salary, amount, date, type) Task: Retrieve value from categories with value above the SUM(amount) of sales rows sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03869
train
v3
Schema: shipments (alias: shp)(salary, date, status, level) regions(salary, id, date, code) Task: Retrieve code from shipments with amount above the AVG(amount) of regions rows sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03870
train
v1
Schema: sales (alias: sale)(date, type, status, code) schedules(amount, salary, date, status) Task: Select code from sales where status exists in schedules for the same id. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03871
train
v2
Schema: tasks (alias: tsk)(id, status, date, salary) orders(amount, salary, name, level) Task: Find id from tasks where a matching record exists in orders with the same level. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03872
train
v3
Schema: projects (alias: prj)(code, status, id, amount) shipments(value, type, salary, status) Task: Find code from projects where amount exceeds the minimum salary from shipments for the same status. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.status = prj.status );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03873
train
v3
Schema: projects (alias: prj)(salary, code, id, status) branches(salary, value, date, code) Task: Retrieve code from projects with value above the MIN(amount) of branches rows sharing the same status. SQL:
SELECT code FROM projects AS prj WHERE value > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.status = prj.status );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03874
train
v1
Schema: staff (alias: empl)(amount, id, code, value) accounts(salary, code, id, value) Task: Select code from staff where status exists in accounts for the same type. SQL:
SELECT code FROM staff AS empl WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = empl.type );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03875
train
v1
Schema: managers (alias: mgr)(value, status, salary, type) sales(type, id, level, status) Task: Retrieve salary from managers whose id is found in sales rows where level matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03876
train
v1
Schema: categories (alias: catg)(type, status, code, salary) sales(type, name, amount, id) Task: Find name from categories where code appears in sales entries with matching level. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = catg.level );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03877
train
v1
Schema: projects (alias: prj)(id, date, type, status) accounts(id, value, amount, type) Task: Find name from projects where type appears in accounts entries with matching status. SQL:
SELECT name FROM projects AS prj WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = prj.status );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03878
train
v1
Schema: orders (alias: ord)(name, code, date, status) regions(status, type, salary, id) Task: Retrieve value from orders whose code is found in regions rows where status matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03879
train
v1
Schema: transactions (alias: txn)(code, level, status, id) staff(type, name, salary, id) Task: Select id from transactions where level exists in staff for the same status. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = txn.status );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03880
train
v1
Schema: staff (alias: empl)(code, name, amount, value) regions(status, name, salary, type) Task: Select salary from staff where id exists in regions for the same type. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = empl.type );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03881
train
v3
Schema: customers (alias: cust)(type, value, id, name) projects(level, date, salary, code) Task: Retrieve code from customers with salary above the COUNT(salary) of projects rows sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.type = cust.type );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03882
train
v3
Schema: requests (alias: ordr)(type, status, value, code) transactions(level, id, salary, type) Task: Find id from requests where value exceeds the minimum amount from transactions for the same id. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03883
train
v1
Schema: sales (alias: sale)(type, name, date, code) regions(status, value, type, level) Task: Select amount from sales where type exists in regions for the same level. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03884
train
v2
Schema: products (alias: prod)(code, amount, date, id) orders(type, level, value, amount) Task: Retrieve id from products that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03885
train
v1
Schema: transactions (alias: txn)(amount, type, level, value) branches(date, code, level, amount) Task: Retrieve amount from transactions whose type is found in branches rows where status matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03886
train
v1
Schema: schedules (alias: schd)(amount, status, id, type) employees(type, code, date, status) Task: Select value from schedules where code exists in employees for the same status. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03887
train
v1
Schema: tasks (alias: tsk)(code, amount, id, name) departments(level, date, id, name) Task: Retrieve amount from tasks whose id is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03888
train
v3
Schema: sales (alias: sale)(type, salary, amount, id) items(value, id, name, type) Task: Retrieve amount from sales with amount above the AVG(salary) of items rows sharing the same level. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03889
train
v1
Schema: tasks (alias: tsk)(level, amount, value, date) items(status, date, level, value) Task: Find name from tasks where id appears in items entries with matching type. SQL:
SELECT name FROM tasks AS tsk WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03890
train
v3
Schema: transactions (alias: txn)(status, id, code, amount) regions(salary, name, value, id) Task: Retrieve code from transactions with salary above the AVG(amount) of regions rows sharing the same level. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03891
train
v2
Schema: shipments (alias: shp)(name, amount, date, value) orders(salary, id, name, code) Task: Find amount from shipments where a matching record exists in orders with the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03892
train
v1
Schema: projects (alias: prj)(value, amount, date, salary) managers(level, name, date, status) Task: Select name from projects where code exists in managers for the same code. SQL:
SELECT name FROM projects AS prj WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = prj.code );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03893
train
v3
Schema: departments (alias: dept)(amount, level, code, date) categories(level, name, amount, status) Task: Retrieve code from departments with value above the MIN(salary) of categories rows sharing the same id. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03894
train
v3
Schema: categories (alias: catg)(code, level, date, status) invoices(level, name, code, amount) Task: Retrieve id from categories with amount above the MIN(amount) of invoices rows sharing the same status. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = catg.status );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03895
train
v1
Schema: requests (alias: ordr)(status, id, amount, level) regions(value, id, salary, date) Task: Select value from requests where code exists in regions for the same code. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03896
train
v3
Schema: requests (alias: ordr)(id, value, salary, type) branches(code, level, status, amount) Task: Retrieve id from requests with salary above the AVG(salary) of branches rows sharing the same type. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03897
train
v1
Schema: sales (alias: sale)(name, level, code, date) schedules(value, amount, id, salary) Task: Find code from sales where status appears in schedules entries with matching id. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03898
train
v1
Schema: items (alias: lne)(value, type, amount, status) staff(type, amount, status, date) Task: Find salary from items where code appears in staff entries with matching id. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03899
train