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: branches (alias: brc)(code, id, salary, type) customers(name, value, type, status) Task: Find value from branches where type appears in customers entries with matching id. SQL:
SELECT value FROM branches AS brc WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = brc.id );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18800
train
v2
Schema: items (alias: lne)(type, level, value, amount) branches(name, amount, value, status) Task: Find value from items where a matching record exists in branches with the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = lne.status );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18801
train
v2
Schema: customers (alias: cust)(id, name, amount, salary) invoices(salary, code, status, id) Task: Find name from customers where a matching record exists in invoices with the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18802
train
v3
Schema: employees (alias: emp)(name, date, code, id) categories(value, type, date, code) Task: Retrieve id from employees with amount above the MAX(value) of categories rows sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18803
train
v2
Schema: departments (alias: dept)(code, amount, level, status) accounts(id, level, status, type) Task: Retrieve name from departments that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18804
train
v3
Schema: departments (alias: dept)(date, amount, level, value) shipments(level, status, date, name) Task: Find amount from departments where amount exceeds the count of value from shipments for the same level. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18805
train
v2
Schema: tasks (alias: tsk)(code, salary, type, status) orders(level, salary, code, date) Task: Find value from tasks where a matching record exists in orders with the same level. SQL:
SELECT value 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": "value", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18806
train
v3
Schema: branches (alias: brc)(amount, value, type, level) projects(id, name, value, salary) Task: Retrieve id from branches with value above the MAX(value) of projects rows sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT MAX(value) FROM projects AS prj WHERE prj.type = brc.type );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18807
train
v3
Schema: staff (alias: empl)(amount, date, value, status) customers(salary, name, amount, date) Task: Retrieve amount from staff with amount above the COUNT(amount) of customers rows sharing the same status. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18808
train
v3
Schema: customers (alias: cust)(date, id, level, amount) orders(type, value, id, name) Task: Find name from customers where value exceeds the maximum amount from orders for the same type. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18809
train
v2
Schema: departments (alias: dept)(type, status, name, id) shipments(salary, level, id, name) Task: Retrieve amount from departments that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18810
train
v1
Schema: requests (alias: ordr)(status, name, level, amount) managers(salary, code, type, amount) Task: Retrieve id from requests whose type is found in managers rows where id matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18811
train
v1
Schema: invoices (alias: inv)(status, date, level, code) shipments(salary, name, amount, date) Task: Retrieve value from invoices whose code is found in shipments rows where status matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18812
train
v1
Schema: items (alias: lne)(code, amount, type, date) regions(code, type, value, name) Task: Find salary from items where id appears in regions entries with matching status. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18813
train
v3
Schema: managers (alias: mgr)(id, status, amount, code) transactions(type, id, date, level) Task: Find salary from managers where salary exceeds the minimum value from transactions for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18814
train
v2
Schema: products (alias: prod)(type, amount, name, value) managers(id, date, level, code) Task: Retrieve name from products that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18815
train
v1
Schema: sales (alias: sale)(level, salary, value, code) managers(value, name, amount, level) Task: Find value from sales where code appears in managers entries with matching type. SQL:
SELECT value FROM sales AS sale WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18816
train
v2
Schema: accounts (alias: acct)(code, value, date, type) transactions(level, date, salary, id) Task: Find id from accounts where a matching record exists in transactions with the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18817
train
v1
Schema: projects (alias: prj)(type, amount, value, status) transactions(type, salary, value, date) Task: Find amount from projects where type appears in transactions entries with matching type. SQL:
SELECT amount FROM projects AS prj WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = prj.type );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18818
train
v2
Schema: branches (alias: brc)(id, salary, status, amount) regions(id, name, type, date) Task: Retrieve salary from branches that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = brc.id );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "salary", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18819
train
v1
Schema: customers (alias: cust)(code, name, date, status) accounts(level, type, id, name) Task: Find value from customers where code appears in accounts entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18820
train
v3
Schema: employees (alias: emp)(amount, level, date, salary) schedules(level, name, code, amount) Task: Find name from employees where value exceeds the count of value from schedules for the same level. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18821
train
v1
Schema: projects (alias: prj)(type, status, level, value) items(salary, amount, code, id) Task: Retrieve value from projects whose status is found in items rows where status matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = prj.status );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18822
train
v1
Schema: customers (alias: cust)(value, type, level, name) transactions(code, status, amount, id) Task: Retrieve value from customers whose type is found in transactions rows where level matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18823
train
v2
Schema: products (alias: prod)(value, level, name, type) requests(date, type, salary, level) Task: Find code from products where a matching record exists in requests with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = prod.level );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18824
train
v1
Schema: accounts (alias: acct)(id, level, value, date) projects(amount, value, id, name) Task: Retrieve amount from accounts whose level is found in projects rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18825
train
v1
Schema: products (alias: prod)(id, status, value, salary) customers(salary, name, level, date) Task: Retrieve salary from products whose level is found in customers rows where status matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18826
train
v3
Schema: items (alias: lne)(salary, type, date, name) projects(value, type, level, name) Task: Retrieve salary from items with salary above the AVG(value) of projects rows sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT AVG(value) FROM projects AS prj WHERE prj.id = lne.id );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18827
train
v1
Schema: shipments (alias: shp)(amount, id, level, date) regions(name, salary, level, date) Task: Select value from shipments where level exists in regions for the same code. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18828
train
v1
Schema: regions (alias: rgn)(amount, code, salary, name) employees(date, level, id, salary) Task: Retrieve code from regions whose level is found in employees rows where status matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18829
train
v2
Schema: managers (alias: mgr)(date, code, value, id) orders(amount, type, id, code) Task: Find salary from managers where a matching record exists in orders with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18830
train
v2
Schema: accounts (alias: acct)(amount, code, date, salary) categories(amount, code, name, date) Task: Retrieve id from accounts that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18831
train
v1
Schema: departments (alias: dept)(date, type, status, amount) invoices(code, name, type, salary) Task: Select salary from departments where code exists in invoices for the same level. SQL:
SELECT salary FROM departments AS dept WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = dept.level );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18832
train
v1
Schema: regions (alias: rgn)(date, status, name, salary) projects(code, level, salary, value) Task: Find salary from regions where level appears in projects entries with matching type. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = rgn.type );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18833
train
v2
Schema: invoices (alias: inv)(date, status, salary, name) transactions(code, value, level, id) Task: Find code from invoices where a matching record exists in transactions with the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18834
train
v2
Schema: regions (alias: rgn)(type, status, date, level) employees(level, name, date, type) Task: Find name from regions where a matching record exists in employees with the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18835
train
v2
Schema: tasks (alias: tsk)(salary, status, code, date) branches(status, name, salary, level) Task: Retrieve name from tasks that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18836
train
v2
Schema: invoices (alias: inv)(status, value, level, type) categories(level, id, name, value) Task: Find id from invoices where a matching record exists in categories with the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18837
train
v2
Schema: orders (alias: ord)(id, status, amount, date) schedules(status, type, id, salary) Task: Find salary from orders where a matching record exists in schedules with the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18838
train
v3
Schema: projects (alias: prj)(level, date, amount, name) managers(salary, name, date, level) Task: Find code from projects where salary exceeds the total salary from managers for the same level. SQL:
SELECT code FROM projects AS prj WHERE salary > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.level = prj.level );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18839
train
v1
Schema: products (alias: prod)(amount, value, code, status) projects(id, type, amount, value) Task: Find salary from products where level appears in projects entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.status = prod.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18840
train
v3
Schema: schedules (alias: schd)(status, type, value, name) customers(date, amount, name, value) Task: Retrieve name from schedules with amount above the AVG(salary) of customers rows sharing the same code. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.code = schd.code );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18841
train
v2
Schema: regions (alias: rgn)(amount, name, value, date) projects(type, name, id, status) Task: Find name from regions where a matching record exists in projects with the same code. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = rgn.code );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18842
train
v1
Schema: invoices (alias: inv)(status, code, type, salary) departments(level, id, value, code) Task: Select code from invoices where type exists in departments for the same level. SQL:
SELECT code FROM invoices AS inv WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18843
train
v2
Schema: schedules (alias: schd)(value, id, status, name) products(level, date, name, id) Task: Find amount from schedules where a matching record exists in products with the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18844
train
v1
Schema: products (alias: prod)(type, id, amount, code) accounts(level, date, value, amount) Task: Select name from products where type exists in accounts for the same code. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18845
train
v2
Schema: transactions (alias: txn)(name, type, code, date) categories(salary, value, code, status) Task: Retrieve code from transactions that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18846
train
v3
Schema: shipments (alias: shp)(status, date, id, type) accounts(level, name, type, status) Task: Retrieve name from shipments with amount above the MIN(salary) of accounts rows sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.type = shp.type );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18847
train
v1
Schema: employees (alias: emp)(code, status, amount, date) regions(id, date, amount, value) Task: Retrieve value from employees whose level is found in regions rows where status matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18848
train
v1
Schema: shipments (alias: shp)(name, code, date, status) orders(type, status, date, salary) Task: Retrieve amount from shipments whose id is found in orders rows where level matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18849
train
v2
Schema: projects (alias: prj)(level, salary, type, name) transactions(amount, id, code, name) Task: Retrieve salary from projects that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "salary", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18850
train
v3
Schema: schedules (alias: schd)(value, level, code, date) regions(code, amount, value, type) Task: Retrieve name from schedules with value above the SUM(amount) of regions rows sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18851
train
v1
Schema: staff (alias: empl)(name, level, amount, date) requests(salary, name, id, amount) Task: Retrieve code from staff whose status is found in requests rows where id matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18852
train
v2
Schema: products (alias: prod)(salary, name, type, status) regions(status, id, type, date) Task: Retrieve id from products that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18853
train
v3
Schema: accounts (alias: acct)(status, name, type, level) projects(amount, salary, status, name) Task: Retrieve name from accounts with value above the MAX(value) of projects rows sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT MAX(value) FROM projects AS prj WHERE prj.id = acct.id );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18854
train
v2
Schema: orders (alias: ord)(code, date, level, salary) tasks(amount, id, value, date) Task: Retrieve salary from orders that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = ord.type );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "salary", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18855
train
v2
Schema: branches (alias: brc)(type, name, salary, code) categories(date, name, salary, code) Task: Retrieve name from branches that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = brc.id );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18856
train
v1
Schema: employees (alias: emp)(date, value, type, amount) invoices(status, id, type, value) Task: Find salary from employees where type appears in invoices entries with matching level. SQL:
SELECT salary FROM employees AS emp WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18857
train
v2
Schema: invoices (alias: inv)(code, value, date, name) departments(value, level, type, salary) Task: Find amount from invoices where a matching record exists in departments with the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18858
train
v2
Schema: sales (alias: sale)(date, code, type, status) customers(level, date, amount, status) Task: Find value from sales where a matching record exists in customers with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = sale.type );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18859
train
v3
Schema: shipments (alias: shp)(level, date, code, amount) accounts(status, name, level, code) Task: Find salary from shipments where amount exceeds the total value from accounts for the same id. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18860
train
v1
Schema: managers (alias: mgr)(salary, value, status, amount) invoices(id, date, amount, salary) Task: Select code from managers where type exists in invoices for the same status. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = mgr.status );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18861
train
v3
Schema: invoices (alias: inv)(value, date, level, status) tasks(level, status, name, salary) Task: Retrieve amount from invoices with value above the AVG(value) of tasks rows sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.status = inv.status );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18862
train
v2
Schema: accounts (alias: acct)(level, name, type, date) managers(status, name, value, level) Task: Find name from accounts where a matching record exists in managers with the same id. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18863
train
v3
Schema: requests (alias: ordr)(amount, id, status, value) managers(value, code, date, name) Task: Find code from requests where value exceeds the total salary from managers for the same status. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18864
train
v1
Schema: categories (alias: catg)(type, name, date, level) employees(value, code, status, amount) Task: Retrieve value from categories whose level is found in employees rows where level matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.level = catg.level );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18865
train
v1
Schema: sales (alias: sale)(value, amount, status, type) projects(code, amount, date, level) Task: Select name from sales where status exists in projects for the same id. SQL:
SELECT name FROM sales AS sale WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = sale.id );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18866
train
v3
Schema: customers (alias: cust)(date, type, amount, id) items(id, code, type, level) Task: Find amount from customers where value exceeds the average salary from items for the same status. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18867
train
v3
Schema: branches (alias: brc)(name, salary, code, level) customers(date, salary, amount, code) Task: Retrieve code from branches with salary above the MAX(value) of customers rows sharing the same type. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18868
train
v1
Schema: departments (alias: dept)(level, code, status, value) customers(date, level, id, value) Task: Find value from departments where code appears in customers entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18869
train
v2
Schema: sales (alias: sale)(status, level, code, name) items(name, type, salary, code) Task: Find value from sales where a matching record exists in items with the same id. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "value", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18870
train
v1
Schema: sales (alias: sale)(status, code, name, level) invoices(value, amount, id, code) Task: Retrieve code from sales whose code is found in invoices rows where status matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.status = sale.status );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18871
train
v1
Schema: products (alias: prod)(value, amount, status, code) sales(amount, type, name, id) Task: Find code from products where level appears in sales entries with matching code. SQL:
SELECT code FROM products AS prod WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18872
train
v3
Schema: shipments (alias: shp)(id, value, salary, code) schedules(date, id, salary, amount) Task: Retrieve name from shipments with salary above the COUNT(salary) of schedules rows sharing the same id. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18873
train
v2
Schema: managers (alias: mgr)(value, name, date, salary) requests(date, level, status, id) Task: Find id from managers where a matching record exists in requests with the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18874
train
v3
Schema: managers (alias: mgr)(name, amount, status, value) transactions(value, amount, status, name) Task: Retrieve name from managers with salary above the MAX(amount) of transactions rows sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18875
train
v1
Schema: sales (alias: sale)(level, id, type, amount) branches(id, name, salary, date) Task: Select code from sales where status exists in branches for the same level. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = sale.level );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18876
train
v2
Schema: orders (alias: ord)(amount, status, date, type) projects(id, code, amount, level) Task: Find code from orders where a matching record exists in projects with the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = ord.status );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18877
train
v2
Schema: managers (alias: mgr)(name, type, value, salary) accounts(amount, value, name, date) Task: Find value from managers where a matching record exists in accounts with the same status. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18878
train
v1
Schema: tasks (alias: tsk)(id, type, name, salary) items(status, value, id, salary) Task: Select amount from tasks where status exists in items for the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18879
train
v3
Schema: schedules (alias: schd)(code, name, type, status) projects(status, name, code, id) Task: Find value from schedules where value exceeds the count of salary from projects for the same code. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18880
train
v1
Schema: employees (alias: emp)(value, name, type, status) shipments(code, id, status, level) Task: Select id from employees where status exists in shipments for the same type. SQL:
SELECT id FROM employees AS emp WHERE status IN ( SELECT status 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": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18881
train
v1
Schema: schedules (alias: schd)(date, salary, value, code) projects(value, level, status, code) Task: Select value from schedules where code exists in projects for the same id. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = schd.id );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18882
train
v1
Schema: tasks (alias: tsk)(id, level, type, amount) regions(code, level, name, salary) Task: Select amount from tasks where type exists in regions for the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18883
train
v2
Schema: schedules (alias: schd)(salary, amount, type, level) sales(name, status, type, level) Task: Find name from schedules where a matching record exists in sales with the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18884
train
v3
Schema: projects (alias: prj)(date, code, type, amount) sales(value, salary, level, name) Task: Retrieve salary from projects with value above the MIN(value) of sales rows sharing the same level. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT MIN(value) FROM sales AS sale WHERE sale.level = prj.level );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18885
train
v2
Schema: products (alias: prod)(code, date, name, amount) sales(amount, name, code, status) Task: Find salary from products where a matching record exists in sales with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18886
train
v3
Schema: sales (alias: sale)(id, status, type, level) transactions(salary, status, type, level) Task: Find code from sales where value exceeds the total value from transactions for the same type. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18887
train
v2
Schema: regions (alias: rgn)(amount, value, name, level) staff(code, level, type, amount) Task: Retrieve salary from regions that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = rgn.type );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18888
train
v2
Schema: accounts (alias: acct)(code, type, name, status) branches(salary, value, amount, level) Task: Find value from accounts where a matching record exists in branches with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18889
train
v2
Schema: transactions (alias: txn)(level, id, status, salary) accounts(code, status, amount, level) Task: Find value from transactions where a matching record exists in accounts with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = txn.level );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18890
train
v3
Schema: branches (alias: brc)(type, id, level, amount) tasks(salary, name, type, value) Task: Retrieve amount from branches with salary above the MIN(amount) of tasks rows sharing the same status. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.status = brc.status );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18891
train
v2
Schema: orders (alias: ord)(value, type, id, salary) staff(id, salary, value, amount) Task: Retrieve id from orders that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ord.status );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18892
train
v3
Schema: shipments (alias: shp)(date, salary, value, type) departments(id, level, value, date) Task: Find salary from shipments where amount exceeds the average salary from departments for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18893
train
v1
Schema: categories (alias: catg)(id, date, level, status) tasks(value, salary, type, name) Task: Select id from categories where level exists in tasks for the same level. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.level = catg.level );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18894
train
v1
Schema: departments (alias: dept)(id, code, amount, date) staff(date, type, code, status) Task: Find name from departments where code appears in staff entries with matching id. SQL:
SELECT name FROM departments AS dept WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = dept.id );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18895
train
v2
Schema: schedules (alias: schd)(amount, value, type, name) customers(name, date, id, type) Task: Retrieve salary from schedules that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18896
train
v2
Schema: transactions (alias: txn)(type, name, amount, date) projects(value, code, salary, amount) Task: Retrieve code from transactions that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18897
train
v2
Schema: managers (alias: mgr)(name, date, status, value) departments(value, amount, type, date) Task: Find name from managers where a matching record exists in departments with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18898
train
v1
Schema: shipments (alias: shp)(type, status, amount, value) items(code, id, amount, status) Task: Retrieve id from shipments whose id is found in items rows where level matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = shp.level );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18899
train