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: projects (alias: prj)(id, code, type, value) requests(amount, code, id, level) Task: Retrieve value from projects whose status is found in requests rows where level matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = prj.level );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06300
train
v1
Schema: employees (alias: emp)(value, status, code, type) items(id, value, salary, name) Task: Retrieve value from employees whose id is found in items rows where status matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06301
train
v3
Schema: categories (alias: catg)(date, name, status, salary) schedules(salary, value, type, status) Task: Find id from categories where salary exceeds the minimum salary from schedules for the same status. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = catg.status );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06302
train
v1
Schema: employees (alias: emp)(code, salary, type, level) managers(amount, level, status, code) Task: Find name from employees where code appears in managers entries with matching id. SQL:
SELECT name FROM employees AS emp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06303
train
v2
Schema: accounts (alias: acct)(code, amount, date, id) customers(code, id, salary, type) Task: Find amount from accounts where a matching record exists in customers with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06304
train
v2
Schema: invoices (alias: inv)(type, name, salary, id) categories(value, id, type, code) Task: Find amount from invoices where a matching record exists in categories with the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06305
train
v1
Schema: invoices (alias: inv)(salary, code, status, name) employees(status, salary, name, code) Task: Select value from invoices where status exists in employees for the same id. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06306
train
v2
Schema: items (alias: lne)(date, salary, value, name) accounts(status, value, date, level) Task: Find value from items where a matching record exists in accounts with the same type. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06307
train
v1
Schema: projects (alias: prj)(status, level, salary, amount) items(amount, status, salary, type) Task: Select code from projects where id exists in items for the same code. SQL:
SELECT code FROM projects AS prj WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06308
train
v2
Schema: orders (alias: ord)(salary, amount, level, type) requests(date, level, name, code) Task: Find salary from orders where a matching record exists in requests with the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06309
train
v2
Schema: regions (alias: rgn)(name, amount, date, value) shipments(type, status, level, amount) Task: Retrieve amount from regions that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06310
train
v1
Schema: employees (alias: emp)(id, type, code, amount) tasks(type, level, name, status) Task: Find code from employees where code appears in tasks entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.type = emp.type );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06311
train
v1
Schema: sales (alias: sale)(code, date, id, value) invoices(name, date, value, salary) Task: Retrieve name from sales whose code is found in invoices rows where type matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06312
train
v3
Schema: items (alias: lne)(id, name, status, date) customers(status, salary, date, type) Task: Find salary from items where amount exceeds the maximum value from customers for the same id. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06313
train
v1
Schema: products (alias: prod)(value, status, id, date) sales(name, status, amount, value) Task: Find code from products where type appears in sales entries with matching type. SQL:
SELECT code FROM products AS prod WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06314
train
v1
Schema: orders (alias: ord)(salary, name, status, amount) departments(value, type, date, id) Task: Select name from orders where status exists in departments for the same type. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = ord.type );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06315
train
v1
Schema: categories (alias: catg)(name, date, salary, amount) regions(id, name, status, date) Task: Retrieve code from categories whose level is found in regions rows where level matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06316
train
v1
Schema: sales (alias: sale)(amount, date, id, code) shipments(type, status, date, code) Task: Select code from sales where type exists in shipments for the same level. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06317
train
v3
Schema: accounts (alias: acct)(date, id, amount, code) projects(type, name, salary, status) Task: Retrieve id from accounts with amount above the SUM(amount) of projects rows sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06318
train
v1
Schema: regions (alias: rgn)(status, name, level, amount) schedules(value, name, salary, id) Task: Retrieve code from regions whose code is found in schedules rows where status matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06319
train
v1
Schema: products (alias: prod)(type, date, id, value) staff(code, amount, status, value) Task: Find salary from products where status appears in staff entries with matching code. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = prod.code );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06320
train
v1
Schema: accounts (alias: acct)(value, type, amount, salary) categories(salary, value, date, status) Task: Find salary from accounts where code appears in categories entries with matching id. SQL:
SELECT salary 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": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06321
train
v3
Schema: orders (alias: ord)(salary, type, name, id) staff(value, level, date, salary) Task: Find id from orders where salary exceeds the average value from staff for the same id. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(value) FROM staff AS empl WHERE empl.id = ord.id );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06322
train
v1
Schema: requests (alias: ordr)(name, date, amount, id) employees(level, id, code, status) Task: Find name from requests where level appears in employees entries with matching level. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06323
train
v3
Schema: sales (alias: sale)(date, value, type, code) transactions(code, status, level, date) Task: Retrieve amount from sales with amount above the MIN(value) of transactions rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT MIN(value) 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": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06324
train
v2
Schema: staff (alias: empl)(level, type, date, id) employees(code, date, amount, id) Task: Retrieve value from staff that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06325
train
v2
Schema: transactions (alias: txn)(id, value, name, date) orders(type, amount, id, salary) Task: Retrieve value from transactions that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06326
train
v2
Schema: invoices (alias: inv)(value, amount, id, level) managers(name, amount, salary, date) Task: Find salary from invoices where a matching record exists in managers with the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06327
train
v1
Schema: departments (alias: dept)(name, id, value, code) requests(amount, value, salary, name) Task: Find value from departments where level appears in requests entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06328
train
v2
Schema: projects (alias: prj)(amount, date, value, id) items(status, salary, type, value) Task: Find amount from projects where a matching record exists in items with the same type. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = prj.type );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06329
train
v2
Schema: products (alias: prod)(amount, status, type, date) items(type, status, salary, id) Task: Find amount from products where a matching record exists in items with the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06330
train
v2
Schema: branches (alias: brc)(date, level, type, salary) invoices(type, code, status, id) Task: Find code from branches where a matching record exists in invoices with the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06331
train
v1
Schema: managers (alias: mgr)(type, salary, level, id) departments(type, value, status, date) Task: Find value from managers where code appears in departments entries with matching status. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = mgr.status );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06332
train
v2
Schema: managers (alias: mgr)(date, status, value, amount) employees(status, type, code, name) Task: Retrieve amount from managers that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06333
train
v2
Schema: departments (alias: dept)(date, value, name, amount) transactions(amount, id, code, salary) Task: Retrieve amount from departments that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = dept.status );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06334
train
v3
Schema: invoices (alias: inv)(salary, name, amount, value) schedules(code, type, name, salary) Task: Find salary from invoices where salary exceeds the count of amount from schedules for the same id. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = inv.id );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06335
train
v2
Schema: departments (alias: dept)(status, level, salary, code) sales(name, type, level, salary) Task: Find name from departments where a matching record exists in sales with the same id. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = dept.id );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06336
train
v2
Schema: products (alias: prod)(date, level, code, amount) customers(code, date, level, amount) Task: Find salary from products where a matching record exists in customers with the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06337
train
v1
Schema: projects (alias: prj)(id, status, salary, type) branches(value, status, id, type) Task: Select id from projects where level exists in branches for the same id. SQL:
SELECT id FROM projects AS prj WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.id = prj.id );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06338
train
v2
Schema: sales (alias: sale)(value, level, code, date) shipments(type, value, status, name) Task: Retrieve amount from sales that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06339
train
v1
Schema: staff (alias: empl)(name, date, level, amount) orders(date, id, value, level) Task: Find salary from staff where type appears in orders entries with matching id. SQL:
SELECT salary FROM staff AS empl WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06340
train
v3
Schema: departments (alias: dept)(amount, id, level, code) customers(value, name, level, amount) Task: Retrieve name from departments with salary above the MAX(salary) of customers rows sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.type = dept.type );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06341
train
v1
Schema: orders (alias: ord)(code, value, status, name) tasks(status, type, salary, level) Task: Retrieve name from orders whose status is found in tasks rows where level matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.level = ord.level );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06342
train
v2
Schema: categories (alias: catg)(salary, name, level, type) departments(value, code, name, salary) Task: Retrieve name from categories that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06343
train
v2
Schema: sales (alias: sale)(value, level, status, id) accounts(type, id, salary, code) Task: Find value from sales where a matching record exists in accounts with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06344
train
v3
Schema: requests (alias: ordr)(type, status, salary, code) invoices(date, level, code, status) Task: Find salary from requests where value exceeds the total amount from invoices for the same status. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06345
train
v3
Schema: departments (alias: dept)(salary, id, name, type) shipments(id, level, date, salary) Task: Retrieve value from departments with value above the COUNT(salary) of shipments rows sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.type = dept.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06346
train
v1
Schema: staff (alias: empl)(name, code, type, date) branches(name, type, amount, date) Task: Find value from staff where type appears in branches entries with matching code. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06347
train
v2
Schema: employees (alias: emp)(value, amount, type, salary) invoices(code, type, level, status) Task: Find salary from employees where a matching record exists in invoices with the same code. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = emp.code );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06348
train
v2
Schema: projects (alias: prj)(salary, level, status, id) items(date, type, level, value) Task: Find value from projects where a matching record exists in items with the same status. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = prj.status );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06349
train
v3
Schema: tasks (alias: tsk)(amount, code, level, name) items(status, amount, salary, level) Task: Find amount from tasks where salary exceeds the minimum amount from items for the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT MIN(amount) FROM items AS lne WHERE lne.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06350
train
v1
Schema: transactions (alias: txn)(status, date, id, type) schedules(value, date, type, id) Task: Retrieve value from transactions whose type is found in schedules rows where status matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06351
train
v1
Schema: departments (alias: dept)(id, value, code, type) tasks(amount, code, id, salary) Task: Select salary from departments where status exists in tasks for the same status. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.status = dept.status );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06352
train
v3
Schema: customers (alias: cust)(id, level, code, salary) requests(code, salary, name, id) Task: Retrieve salary from customers with amount above the MAX(value) of requests rows sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06353
train
v1
Schema: branches (alias: brc)(code, type, salary, id) items(amount, name, id, level) Task: Select salary from branches where status exists in items for the same level. SQL:
SELECT salary FROM branches AS brc WHERE status IN ( SELECT status FROM items AS lne WHERE lne.level = brc.level );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06354
train
v1
Schema: invoices (alias: inv)(value, status, salary, type) branches(status, level, date, name) Task: Select amount from invoices where code exists in branches for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06355
train
v3
Schema: sales (alias: sale)(id, date, status, name) accounts(level, salary, name, status) Task: Retrieve id from sales with value above the MIN(salary) of accounts rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06356
train
v3
Schema: managers (alias: mgr)(amount, level, salary, type) invoices(amount, name, date, id) Task: Find value from managers where amount exceeds the count of amount from invoices for the same code. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.code = mgr.code );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06357
train
v3
Schema: requests (alias: ordr)(level, date, value, status) managers(amount, level, code, salary) Task: Find code from requests where salary exceeds the average amount from managers for the same code. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06358
train
v1
Schema: shipments (alias: shp)(type, salary, value, level) regions(status, code, date, value) Task: Retrieve code from shipments whose level is found in regions rows where level matches the outer record. SQL:
SELECT code FROM shipments AS shp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06359
train
v3
Schema: orders (alias: ord)(salary, amount, name, level) employees(type, name, status, date) Task: Retrieve amount from orders with salary above the COUNT(amount) of employees rows sharing the same id. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06360
train
v1
Schema: tasks (alias: tsk)(type, id, status, level) shipments(status, salary, amount, type) Task: Select id from tasks where status exists in shipments for the same status. SQL:
SELECT id FROM tasks AS tsk WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06361
train
v1
Schema: employees (alias: emp)(date, value, id, amount) accounts(level, salary, date, status) Task: Select amount from employees where level exists in accounts for the same code. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06362
train
v1
Schema: categories (alias: catg)(salary, id, type, amount) shipments(id, status, type, date) Task: Find name from categories where code appears in shipments entries with matching status. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06363
train
v1
Schema: invoices (alias: inv)(date, level, status, id) branches(date, level, status, name) Task: Retrieve code from invoices whose status is found in branches rows where id matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06364
train
v1
Schema: shipments (alias: shp)(status, level, type, name) sales(value, id, date, name) Task: Find code from shipments where id appears in sales entries with matching status. SQL:
SELECT code FROM shipments AS shp WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.status = shp.status );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06365
train
v2
Schema: transactions (alias: txn)(date, amount, value, code) invoices(level, code, amount, type) Task: Find amount from transactions where a matching record exists in invoices with the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06366
train
v3
Schema: departments (alias: dept)(value, date, name, type) orders(value, id, salary, name) Task: Find value from departments where value exceeds the minimum value from orders for the same level. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06367
train
v2
Schema: products (alias: prod)(salary, name, value, amount) categories(salary, amount, status, value) Task: Find name from products where a matching record exists in categories with the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prod.type );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06368
train
v2
Schema: tasks (alias: tsk)(code, name, type, id) departments(amount, date, value, salary) Task: Find amount from tasks where a matching record exists in departments with the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06369
train
v3
Schema: items (alias: lne)(value, id, name, date) schedules(value, salary, code, type) Task: Retrieve amount from items with value above the MIN(amount) of schedules rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.id = lne.id );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06370
train
v3
Schema: staff (alias: empl)(salary, level, status, name) sales(level, value, status, id) Task: Find value from staff where value exceeds the average value from sales for the same status. SQL:
SELECT value FROM staff AS empl WHERE value > ( SELECT AVG(value) 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": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06371
train
v2
Schema: departments (alias: dept)(amount, name, code, salary) employees(id, name, type, salary) Task: Find salary from departments where a matching record exists in employees with the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06372
train
v2
Schema: departments (alias: dept)(id, name, amount, status) shipments(code, type, status, level) Task: Find id from departments where a matching record exists in shipments with the same level. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06373
train
v1
Schema: tasks (alias: tsk)(level, salary, code, value) departments(date, amount, salary, id) Task: Retrieve salary from tasks whose type is found in departments rows where type matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06374
train
v2
Schema: projects (alias: prj)(level, id, status, value) employees(type, date, name, level) Task: Find code from projects where a matching record exists in employees with the same id. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = prj.id );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06375
train
v1
Schema: categories (alias: catg)(status, level, value, salary) invoices(value, name, id, level) Task: Find salary from categories where code appears in invoices entries with matching id. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06376
train
v3
Schema: departments (alias: dept)(date, name, code, salary) items(type, name, status, id) Task: Retrieve salary from departments with amount above the MIN(amount) of items rows sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MIN(amount) FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06377
train
v3
Schema: requests (alias: ordr)(amount, status, level, name) shipments(name, salary, amount, code) Task: Retrieve name from requests with value above the MIN(value) of shipments rows sharing the same type. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06378
train
v3
Schema: staff (alias: empl)(name, amount, level, code) tasks(status, date, salary, amount) Task: Retrieve id from staff with amount above the MAX(value) of tasks rows sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.code = empl.code );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06379
train
v2
Schema: invoices (alias: inv)(salary, id, code, name) departments(name, amount, salary, value) Task: Find value from invoices where a matching record exists in departments with the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06380
train
v2
Schema: accounts (alias: acct)(id, code, salary, name) transactions(date, name, status, level) Task: Find code from accounts where a matching record exists in transactions with the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06381
train
v2
Schema: customers (alias: cust)(value, level, date, amount) products(level, code, salary, type) Task: Retrieve amount from customers that have at least one corresponding entry in products sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06382
train
v2
Schema: products (alias: prod)(type, date, code, name) projects(id, date, code, salary) Task: Retrieve id from products that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = prod.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06383
train
v3
Schema: departments (alias: dept)(date, code, type, level) items(level, salary, type, amount) Task: Find id from departments where value exceeds the minimum amount from items for the same level. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.level = dept.level );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06384
train
v3
Schema: managers (alias: mgr)(value, type, amount, id) tasks(level, value, type, salary) Task: Find code from managers where value exceeds the minimum value from tasks for the same code. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06385
train
v2
Schema: staff (alias: empl)(date, id, type, status) branches(status, date, type, salary) Task: Find value from staff where a matching record exists in branches with the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06386
train
v1
Schema: staff (alias: empl)(name, level, salary, id) shipments(id, name, salary, amount) Task: Retrieve name from staff whose status is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06387
train
v1
Schema: staff (alias: empl)(salary, amount, type, level) employees(status, amount, level, code) Task: Retrieve value from staff whose level is found in employees rows where status matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = empl.status );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06388
train
v3
Schema: requests (alias: ordr)(name, status, date, value) branches(date, value, status, code) Task: Retrieve id from requests with value above the SUM(amount) of branches rows sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.id = ordr.id );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06389
train
v1
Schema: managers (alias: mgr)(value, amount, name, id) sales(code, amount, status, type) Task: Find id from managers where code appears in sales entries with matching id. SQL:
SELECT id FROM managers AS mgr WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06390
train
v3
Schema: regions (alias: rgn)(salary, date, value, code) branches(type, level, value, name) Task: Retrieve code from regions with value above the MAX(salary) of branches rows sharing the same level. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06391
train
v3
Schema: accounts (alias: acct)(amount, code, type, id) transactions(value, status, amount, name) Task: Find salary from accounts where value exceeds the total salary from transactions for the same code. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06392
train
v1
Schema: categories (alias: catg)(status, id, date, amount) items(salary, code, date, amount) Task: Find code from categories where type appears in items entries with matching status. SQL:
SELECT code FROM categories AS catg WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06393
train
v1
Schema: customers (alias: cust)(name, date, value, code) accounts(date, salary, amount, id) Task: Retrieve name from customers whose code is found in accounts rows where status matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06394
train
v3
Schema: requests (alias: ordr)(amount, value, date, code) projects(salary, amount, level, value) Task: Retrieve code from requests with salary above the COUNT(amount) of projects rows sharing the same id. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.id = ordr.id );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06395
train
v1
Schema: tasks (alias: tsk)(code, value, name, salary) items(value, status, level, name) Task: Find amount from tasks where id appears in items entries with matching level. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06396
train
v1
Schema: sales (alias: sale)(code, value, name, type) employees(code, level, date, name) Task: Select name from sales where status exists in employees for the same level. SQL:
SELECT name FROM sales AS sale WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = sale.level );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06397
train
v3
Schema: schedules (alias: schd)(name, type, level, salary) managers(id, type, status, date) Task: Find id from schedules where amount exceeds the average salary from managers for the same id. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06398
train
v2
Schema: departments (alias: dept)(level, name, id, date) sales(type, status, amount, id) Task: Retrieve name from departments that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06399
train