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: accounts (alias: acct)(date, code, value, status) categories(amount, value, name, id) Task: Find amount from accounts where code appears in categories entries with matching id. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00200
train
v1
Schema: staff (alias: empl)(value, date, status, name) sales(id, salary, code, amount) Task: Find value from staff where code appears in sales entries with matching status. SQL:
SELECT value FROM staff AS empl WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.status = empl.status );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00201
train
v1
Schema: requests (alias: ordr)(code, name, status, id) projects(id, level, date, status) Task: Find salary from requests where status appears in projects entries with matching level. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00202
train
v1
Schema: sales (alias: sale)(date, amount, id, level) transactions(date, level, name, type) Task: Select amount from sales where id exists in transactions for the same id. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00203
train
v1
Schema: invoices (alias: inv)(level, name, date, type) schedules(type, level, status, salary) Task: Retrieve name from invoices whose id is found in schedules rows where status matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00204
train
v3
Schema: products (alias: prod)(code, amount, name, date) customers(amount, status, name, id) Task: Find id from products where value exceeds the maximum value from customers for the same status. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MAX(value) FROM customers AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00205
train
v2
Schema: products (alias: prod)(type, code, level, value) orders(status, amount, type, value) Task: Find amount from products where a matching record exists in orders with the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00206
train
v1
Schema: transactions (alias: txn)(salary, amount, level, name) products(status, level, name, code) Task: Select amount from transactions where code exists in products for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = txn.type );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00207
train
v2
Schema: regions (alias: rgn)(status, type, code, value) managers(name, code, status, level) Task: Retrieve code from regions that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00208
train
v2
Schema: sales (alias: sale)(status, id, type, salary) shipments(type, value, amount, status) Task: Retrieve value from sales that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = sale.id );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00209
train
v3
Schema: customers (alias: cust)(id, level, salary, type) shipments(status, amount, name, level) Task: Retrieve value from customers with salary above the COUNT(salary) of shipments rows sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00210
train
v3
Schema: projects (alias: prj)(type, code, level, status) customers(date, status, salary, code) Task: Retrieve code from projects with value above the SUM(amount) of customers rows sharing the same id. SQL:
SELECT code FROM projects AS prj WHERE value > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.id = prj.id );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00211
train
v1
Schema: managers (alias: mgr)(status, date, id, amount) employees(code, value, name, level) Task: Find id from managers where type appears in employees entries with matching code. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00212
train
v2
Schema: items (alias: lne)(status, code, name, id) customers(value, type, name, level) Task: Find salary from items where a matching record exists in customers with the same status. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = lne.status );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00213
train
v3
Schema: staff (alias: empl)(type, date, status, name) branches(id, level, status, date) Task: Find value from staff where salary exceeds the average salary from branches for the same status. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.status = empl.status );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00214
train
v3
Schema: staff (alias: empl)(code, salary, level, name) managers(status, name, salary, date) Task: Retrieve amount from staff with amount above the MIN(amount) of managers rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00215
train
v2
Schema: employees (alias: emp)(name, date, type, salary) accounts(value, amount, status, salary) Task: Retrieve id from employees that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00216
train
v1
Schema: orders (alias: ord)(salary, code, id, type) products(level, code, id, salary) Task: Retrieve amount from orders whose status is found in products rows where id matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00217
train
v1
Schema: sales (alias: sale)(name, type, id, code) employees(level, name, value, id) Task: Retrieve salary from sales whose id is found in employees rows where code matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = sale.code );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00218
train
v3
Schema: employees (alias: emp)(salary, code, id, value) items(level, type, code, id) Task: Find id from employees where salary exceeds the count of amount from items for the same status. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00219
train
v2
Schema: invoices (alias: inv)(name, id, value, code) staff(level, amount, id, name) Task: Retrieve salary from invoices that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00220
train
v2
Schema: employees (alias: emp)(status, salary, id, code) managers(id, type, level, status) Task: Retrieve value from employees that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00221
train
v2
Schema: staff (alias: empl)(date, name, value, amount) regions(level, salary, status, code) Task: Find name from staff where a matching record exists in regions with the same status. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00222
train
v2
Schema: regions (alias: rgn)(date, salary, status, level) transactions(date, status, salary, name) Task: Find value from regions where a matching record exists in transactions with the same id. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = rgn.id );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00223
train
v3
Schema: products (alias: prod)(salary, value, amount, date) schedules(amount, level, status, name) Task: Retrieve amount from products with amount above the SUM(value) of schedules rows sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00224
train
v3
Schema: shipments (alias: shp)(amount, code, name, status) orders(value, date, type, id) Task: Retrieve value from shipments with value above the MAX(amount) of orders rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00225
train
v1
Schema: shipments (alias: shp)(code, salary, id, status) requests(status, level, value, salary) Task: Find value from shipments where type appears in requests entries with matching code. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00226
train
v3
Schema: regions (alias: rgn)(date, id, value, amount) orders(level, code, amount, id) Task: Retrieve code from regions with value above the SUM(salary) of orders rows sharing the same level. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00227
train
v3
Schema: regions (alias: rgn)(type, name, status, salary) orders(type, name, code, salary) Task: Retrieve salary from regions with value above the SUM(amount) of orders rows sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00228
train
v3
Schema: schedules (alias: schd)(date, salary, code, value) staff(name, salary, amount, level) Task: Find code from schedules where amount exceeds the count of value from staff for the same status. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00229
train
v2
Schema: categories (alias: catg)(level, id, type, amount) orders(value, salary, status, level) Task: Retrieve amount from categories that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = catg.code );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00230
train
v1
Schema: tasks (alias: tsk)(status, date, amount, type) customers(level, type, name, date) Task: Retrieve salary from tasks whose code is found in customers rows where status matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00231
train
v1
Schema: employees (alias: emp)(name, amount, value, level) departments(date, value, salary, type) Task: Find amount from employees where id appears in departments entries with matching type. SQL:
SELECT amount FROM employees AS emp WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00232
train
v3
Schema: accounts (alias: acct)(status, level, amount, value) projects(id, date, type, status) Task: Retrieve code from accounts with salary above the COUNT(salary) of projects rows sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.type = acct.type );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00233
train
v3
Schema: requests (alias: ordr)(id, date, value, code) invoices(value, type, salary, level) Task: Retrieve value from requests with value above the COUNT(salary) of invoices rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00234
train
v3
Schema: projects (alias: prj)(type, code, status, date) accounts(code, type, level, value) Task: Retrieve code from projects with amount above the COUNT(salary) of accounts rows sharing the same type. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.type = prj.type );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00235
train
v3
Schema: customers (alias: cust)(name, status, salary, date) tasks(date, type, id, status) Task: Find code from customers where amount exceeds the count of amount from tasks for the same level. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.level = cust.level );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00236
train
v1
Schema: managers (alias: mgr)(id, status, level, type) products(date, value, status, salary) Task: Find amount from managers where status appears in products entries with matching id. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = mgr.id );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00237
train
v2
Schema: invoices (alias: inv)(amount, value, type, code) projects(type, name, date, level) Task: Find name from invoices where a matching record exists in projects with the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00238
train
v2
Schema: branches (alias: brc)(code, level, name, date) items(id, value, status, type) Task: Retrieve salary from branches that have at least one corresponding entry in items sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = brc.id );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "salary", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00239
train
v1
Schema: projects (alias: prj)(date, status, salary, type) branches(level, salary, status, code) Task: Retrieve amount from projects whose id is found in branches rows where level matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00240
train
v1
Schema: employees (alias: emp)(amount, name, salary, type) departments(status, name, level, date) Task: Find amount from employees where level appears in departments entries with matching code. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00241
train
v2
Schema: staff (alias: empl)(amount, code, salary, date) projects(salary, date, id, amount) Task: Find value from staff where a matching record exists in projects with the same id. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = empl.id );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "value", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00242
train
v3
Schema: orders (alias: ord)(date, salary, code, amount) branches(name, level, salary, code) Task: Find salary from orders where value exceeds the total value from branches for the same code. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT SUM(value) FROM branches AS brc WHERE brc.code = ord.code );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00243
train
v3
Schema: sales (alias: sale)(value, salary, level, code) shipments(salary, code, type, name) Task: Retrieve salary from sales with amount above the AVG(salary) of shipments rows sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00244
train
v2
Schema: branches (alias: brc)(id, name, amount, salary) invoices(value, id, level, salary) Task: Retrieve amount from branches that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = brc.id );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00245
train
v1
Schema: requests (alias: ordr)(type, status, level, salary) branches(value, code, salary, amount) Task: Select code from requests where type exists in branches for the same status. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00246
train
v1
Schema: staff (alias: empl)(date, status, name, code) managers(value, level, salary, name) Task: Select code from staff where level exists in managers for the same id. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = empl.id );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00247
train
v3
Schema: products (alias: prod)(code, type, level, status) transactions(name, code, level, salary) Task: Find amount from products where salary exceeds the average amount from transactions for the same code. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00248
train
v2
Schema: accounts (alias: acct)(type, salary, name, status) products(salary, value, id, name) Task: Retrieve code from accounts that have at least one corresponding entry in products sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = acct.code );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00249
train
v1
Schema: shipments (alias: shp)(level, id, type, value) branches(salary, date, code, amount) Task: Select amount from shipments where level exists in branches for the same id. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.id = shp.id );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00250
train
v1
Schema: customers (alias: cust)(value, level, salary, id) requests(value, salary, status, code) Task: Select amount from customers where status exists in requests for the same status. SQL:
SELECT amount FROM customers AS cust WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = cust.status );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00251
train
v1
Schema: customers (alias: cust)(value, code, salary, amount) schedules(status, type, code, id) Task: Select value from customers where code exists in schedules for the same type. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00252
train
v2
Schema: shipments (alias: shp)(value, date, code, level) invoices(status, type, level, code) Task: Find value from shipments where a matching record exists in invoices with the same status. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = shp.status );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00253
train
v3
Schema: sales (alias: sale)(status, name, type, amount) items(date, id, code, name) Task: Retrieve name from sales with value above the SUM(amount) of items rows sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT SUM(amount) FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00254
train
v2
Schema: shipments (alias: shp)(name, type, level, id) departments(name, level, amount, value) Task: Find code from shipments where a matching record exists in departments with the same code. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00255
train
v3
Schema: orders (alias: ord)(level, code, name, date) branches(code, name, amount, level) Task: Find id from orders where salary exceeds the average salary from branches for the same type. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.type = ord.type );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00256
train
v3
Schema: staff (alias: empl)(salary, amount, value, date) sales(type, value, salary, level) Task: Find name from staff where value exceeds the maximum value from sales for the same id. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00257
train
v3
Schema: orders (alias: ord)(amount, code, status, type) tasks(status, code, salary, date) Task: Find id from orders where salary exceeds the total amount from tasks for the same id. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.id = ord.id );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00258
train
v2
Schema: customers (alias: cust)(value, date, code, level) sales(type, status, id, salary) Task: Retrieve name from customers that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = cust.status );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00259
train
v2
Schema: invoices (alias: inv)(amount, name, id, date) staff(name, id, code, level) Task: Retrieve amount from invoices that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = inv.id );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00260
train
v2
Schema: branches (alias: brc)(amount, type, date, value) products(date, level, type, value) Task: Find value from branches where a matching record exists in products with the same level. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = brc.level );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00261
train
v1
Schema: employees (alias: emp)(amount, name, salary, value) requests(type, status, id, code) Task: Select id from employees where type exists in requests for the same level. SQL:
SELECT id FROM employees AS emp WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00262
train
v1
Schema: products (alias: prod)(value, id, name, status) invoices(date, name, amount, level) Task: Find amount from products where id appears in invoices entries with matching id. SQL:
SELECT amount FROM products AS prod WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00263
train
v2
Schema: transactions (alias: txn)(code, name, date, amount) regions(value, date, amount, level) Task: Retrieve name from transactions that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00264
train
v2
Schema: categories (alias: catg)(name, salary, amount, status) schedules(id, date, type, value) Task: Retrieve code from categories that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00265
train
v3
Schema: categories (alias: catg)(salary, level, date, status) tasks(salary, name, id, type) Task: Find value from categories where salary exceeds the average salary from tasks for the same status. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.status = catg.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00266
train
v2
Schema: employees (alias: emp)(type, status, value, salary) projects(date, amount, name, status) Task: Retrieve amount from employees that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = emp.type );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00267
train
v2
Schema: customers (alias: cust)(amount, level, salary, code) employees(code, type, name, date) Task: Find id from customers where a matching record exists in employees with the same id. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00268
train
v2
Schema: projects (alias: prj)(date, salary, amount, level) categories(id, type, date, status) Task: Find salary from projects where a matching record exists in categories with the same level. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = prj.level );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "salary", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00269
train
v2
Schema: invoices (alias: inv)(code, amount, type, level) products(id, name, code, status) Task: Find salary from invoices where a matching record exists in products with the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00270
train
v3
Schema: transactions (alias: txn)(level, salary, type, value) shipments(value, amount, level, date) Task: Retrieve amount from transactions with salary above the MAX(amount) of shipments rows sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00271
train
v1
Schema: transactions (alias: txn)(date, level, value, name) employees(value, date, type, code) Task: Select amount from transactions where type exists in employees for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00272
train
v2
Schema: projects (alias: prj)(id, name, salary, level) requests(id, name, salary, code) Task: Retrieve id from projects that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = prj.type );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00273
train
v2
Schema: categories (alias: catg)(name, amount, salary, id) orders(amount, date, level, code) Task: Find salary from categories where a matching record exists in orders with the same id. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00274
train
v1
Schema: sales (alias: sale)(type, code, name, date) categories(status, level, code, value) Task: Retrieve amount from sales whose type is found in categories rows where id matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = sale.id );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00275
train
v1
Schema: invoices (alias: inv)(amount, level, type, id) categories(id, salary, date, amount) Task: Find amount from invoices where id appears in categories entries with matching type. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00276
train
v1
Schema: regions (alias: rgn)(date, value, level, name) branches(id, type, code, status) Task: Find code from regions where code appears in branches entries with matching id. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00277
train
v3
Schema: invoices (alias: inv)(value, type, code, level) products(code, name, value, id) Task: Find id from invoices where amount exceeds the count of salary from products for the same id. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00278
train
v1
Schema: departments (alias: dept)(value, name, date, type) branches(type, id, value, code) Task: Select name from departments where id exists in branches for the same status. SQL:
SELECT name FROM departments AS dept WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = dept.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00279
train
v2
Schema: orders (alias: ord)(salary, value, status, level) regions(code, id, level, name) Task: Find value from orders where a matching record exists in regions with the same status. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00280
train
v3
Schema: products (alias: prod)(id, salary, level, amount) projects(status, level, amount, salary) Task: Retrieve salary from products with salary above the SUM(salary) of projects rows sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.type = prod.type );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00281
train
v2
Schema: projects (alias: prj)(type, name, code, status) requests(name, level, type, salary) Task: Retrieve value from projects that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = prj.code );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00282
train
v1
Schema: shipments (alias: shp)(value, type, code, amount) products(id, salary, name, status) Task: Retrieve name from shipments whose code is found in products rows where level matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00283
train
v3
Schema: schedules (alias: schd)(name, type, level, date) transactions(id, code, level, salary) Task: Retrieve value from schedules with salary above the SUM(amount) of transactions rows sharing the same type. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00284
train
v3
Schema: invoices (alias: inv)(status, code, level, type) employees(id, value, salary, type) Task: Retrieve name from invoices with amount above the SUM(salary) of employees rows sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00285
train
v3
Schema: customers (alias: cust)(type, date, amount, name) items(code, date, salary, name) Task: Retrieve id from customers with amount above the MIN(value) of items rows sharing the same status. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00286
train
v3
Schema: projects (alias: prj)(salary, value, date, type) employees(name, type, salary, date) Task: Find name from projects where value exceeds the minimum value from employees for the same level. SQL:
SELECT name FROM projects AS prj WHERE value > ( SELECT MIN(value) FROM employees AS emp WHERE emp.level = prj.level );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "name", "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_00287
train
v3
Schema: departments (alias: dept)(amount, salary, name, date) categories(code, value, id, salary) Task: Retrieve code from departments with salary above the AVG(amount) of categories rows sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00288
train
v2
Schema: categories (alias: catg)(value, code, status, name) staff(name, type, salary, code) Task: Retrieve code from categories that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00289
train
v3
Schema: accounts (alias: acct)(level, status, amount, id) employees(id, code, name, status) Task: Find salary from accounts where salary exceeds the average value from employees for the same type. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00290
train
v1
Schema: sales (alias: sale)(amount, level, salary, value) staff(id, value, salary, type) Task: Select salary from sales where type exists in staff for the same id. SQL:
SELECT salary FROM sales AS sale WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00291
train
v2
Schema: shipments (alias: shp)(date, value, status, level) products(level, code, name, id) Task: Retrieve code from shipments that have at least one corresponding entry in products sharing the same code. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00292
train
v3
Schema: orders (alias: ord)(code, value, date, status) managers(code, amount, value, name) Task: Find id from orders where value exceeds the count of amount from managers for the same status. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.status = ord.status );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00293
train
v3
Schema: categories (alias: catg)(id, name, level, salary) regions(name, status, amount, date) Task: Find amount from categories where amount exceeds the total amount from regions for the same level. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00294
train
v1
Schema: sales (alias: sale)(name, code, type, amount) invoices(date, code, value, type) Task: Retrieve salary from sales whose type is found in invoices rows where status matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = sale.status );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00295
train
v1
Schema: products (alias: prod)(salary, name, code, status) branches(id, salary, value, level) Task: Select value from products where type exists in branches for the same type. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.type = prod.type );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00296
train
v1
Schema: invoices (alias: inv)(name, amount, id, status) staff(code, level, name, type) Task: Select amount from invoices where type exists in staff for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00297
train
v3
Schema: shipments (alias: shp)(type, date, amount, id) managers(salary, type, id, amount) Task: Find id from shipments where value exceeds the count of value from managers for the same type. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00298
train
v2
Schema: staff (alias: empl)(status, code, salary, date) sales(salary, status, date, code) Task: Retrieve id from staff that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00299
train