variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: transactions (alias: txn)(type, value, date, level) products(salary, value, id, level) Task: Find salary from transactions where a matching record exists in products with the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18600
train
v2
Schema: departments (alias: dept)(value, id, status, code) customers(level, status, id, salary) Task: Retrieve id from departments that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18601
train
v3
Schema: branches (alias: brc)(salary, code, type, id) requests(code, name, type, date) Task: Retrieve value from branches with amount above the AVG(value) of requests rows sharing the same type. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.type = brc.type );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18602
train
v3
Schema: invoices (alias: inv)(id, value, level, salary) managers(id, date, code, salary) Task: Retrieve id from invoices with salary above the MAX(salary) of managers rows sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18603
train
v2
Schema: schedules (alias: schd)(status, id, value, salary) categories(name, status, level, id) Task: Retrieve id from schedules that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18604
train
v2
Schema: employees (alias: emp)(status, code, level, value) staff(type, level, name, status) Task: Find amount from employees where a matching record exists in staff with the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = emp.level );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18605
train
v1
Schema: requests (alias: ordr)(level, salary, value, id) branches(type, date, id, status) Task: Retrieve name from requests whose code is found in branches rows where status matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18606
train
v3
Schema: transactions (alias: txn)(type, id, name, level) projects(date, id, amount, level) Task: Retrieve code from transactions with value above the MAX(value) of projects rows sharing the same status. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT MAX(value) FROM projects AS prj WHERE prj.status = txn.status );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18607
train
v2
Schema: accounts (alias: acct)(type, amount, status, name) tasks(salary, date, code, type) Task: Retrieve value from accounts that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "value", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18608
train
v2
Schema: projects (alias: prj)(level, status, salary, amount) managers(name, status, level, amount) Task: Find amount from projects where a matching record exists in managers with the same type. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = prj.type );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18609
train
v2
Schema: sales (alias: sale)(date, amount, id, code) staff(date, code, name, value) Task: Retrieve id from sales that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18610
train
v2
Schema: shipments (alias: shp)(date, code, salary, value) accounts(type, code, salary, name) Task: Find code from shipments where a matching record exists in accounts with the same code. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18611
train
v2
Schema: branches (alias: brc)(name, date, salary, amount) invoices(type, date, status, value) Task: Retrieve value from branches that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT value 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": "value", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18612
train
v1
Schema: branches (alias: brc)(name, status, level, code) departments(salary, level, type, value) Task: Select name from branches where id exists in departments for the same level. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = brc.level );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18613
train
v2
Schema: staff (alias: empl)(amount, level, status, date) schedules(id, level, value, salary) Task: Find amount from staff where a matching record exists in schedules with the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18614
train
v1
Schema: departments (alias: dept)(amount, level, salary, id) regions(type, amount, salary, value) Task: Select id from departments where level exists in regions for the same type. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18615
train
v1
Schema: branches (alias: brc)(name, amount, value, type) transactions(salary, value, amount, id) Task: Find amount from branches where level appears in transactions entries with matching code. SQL:
SELECT amount FROM branches AS brc WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = brc.code );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18616
train
v3
Schema: regions (alias: rgn)(amount, type, id, level) employees(type, code, salary, level) Task: Find code from regions where value exceeds the maximum value from employees for the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18617
train
v3
Schema: accounts (alias: acct)(value, level, amount, status) products(id, name, status, salary) Task: Retrieve salary from accounts with value above the MAX(amount) of products rows sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT MAX(amount) FROM products AS prod WHERE prod.type = acct.type );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18618
train
v3
Schema: invoices (alias: inv)(id, salary, code, status) employees(amount, level, name, salary) Task: Find salary from invoices where salary exceeds the minimum salary from employees for the same status. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18619
train
v1
Schema: customers (alias: cust)(code, salary, type, id) branches(type, value, amount, status) Task: Find name from customers where status appears in branches entries with matching code. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.code = cust.code );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18620
train
v3
Schema: staff (alias: empl)(status, salary, code, type) projects(value, date, level, code) Task: Retrieve id from staff with salary above the MAX(amount) of projects rows sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18621
train
v2
Schema: orders (alias: ord)(code, name, id, value) invoices(id, date, salary, level) Task: Retrieve code from orders that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18622
train
v2
Schema: projects (alias: prj)(type, date, code, salary) managers(level, name, id, code) Task: Find name from projects where a matching record exists in managers with the same level. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = prj.level );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "name", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18623
train
v3
Schema: transactions (alias: txn)(salary, id, name, type) managers(status, salary, name, date) Task: Retrieve id from transactions with amount above the MAX(amount) of managers rows sharing the same type. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18624
train
v3
Schema: employees (alias: emp)(name, type, value, code) invoices(id, salary, value, date) Task: Find amount from employees where amount exceeds the total amount from invoices for the same id. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18625
train
v1
Schema: shipments (alias: shp)(status, id, name, value) managers(name, code, amount, level) Task: Find id from shipments where status appears in managers entries with matching code. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18626
train
v2
Schema: items (alias: lne)(status, id, level, name) orders(value, status, amount, id) Task: Find value from items where a matching record exists in orders with the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = lne.status );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18627
train
v3
Schema: employees (alias: emp)(date, code, id, status) transactions(salary, id, type, name) Task: Retrieve name from employees with salary above the MIN(amount) of transactions rows sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.code = emp.code );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18628
train
v3
Schema: shipments (alias: shp)(code, salary, id, level) items(code, type, value, date) Task: Retrieve code from shipments with value above the MAX(amount) of items rows sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT MAX(amount) FROM items AS lne WHERE lne.id = shp.id );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18629
train
v2
Schema: orders (alias: ord)(type, salary, amount, date) customers(name, salary, code, id) Task: Find name from orders where a matching record exists in customers with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ord.level );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18630
train
v3
Schema: staff (alias: empl)(code, level, date, amount) products(id, level, name, status) Task: Find value from staff where salary exceeds the maximum salary from products for the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18631
train
v2
Schema: products (alias: prod)(id, name, status, type) invoices(name, amount, value, salary) Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18632
train
v3
Schema: items (alias: lne)(amount, status, date, id) tasks(level, status, code, salary) Task: Retrieve value from items with amount above the SUM(amount) of tasks rows sharing the same level. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18633
train
v2
Schema: branches (alias: brc)(salary, name, date, level) staff(name, date, level, code) Task: Retrieve id from branches that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = brc.type );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18634
train
v1
Schema: items (alias: lne)(code, status, name, value) projects(type, status, code, value) Task: Select code from items where type exists in projects for the same level. SQL:
SELECT code FROM items AS lne WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18635
train
v3
Schema: employees (alias: emp)(value, status, code, type) shipments(salary, id, name, code) Task: Find salary from employees where value exceeds the total amount from shipments for the same status. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18636
train
v3
Schema: shipments (alias: shp)(code, amount, date, type) accounts(id, level, date, status) Task: Find amount from shipments where value exceeds the average amount from accounts for the same code. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18637
train
v3
Schema: projects (alias: prj)(type, status, value, name) items(name, level, code, amount) Task: Retrieve id from projects with value above the AVG(salary) of items rows sharing the same id. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18638
train
v1
Schema: sales (alias: sale)(code, value, status, date) projects(salary, type, level, value) Task: Find amount from sales where code appears in projects entries with matching level. SQL:
SELECT amount FROM sales AS sale WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.level = sale.level );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18639
train
v2
Schema: departments (alias: dept)(status, level, amount, value) projects(level, amount, code, status) Task: Find name from departments where a matching record exists in projects with the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18640
train
v2
Schema: requests (alias: ordr)(code, type, name, value) tasks(status, name, type, id) Task: Find value from requests where a matching record exists in tasks with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = ordr.level );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18641
train
v2
Schema: departments (alias: dept)(type, status, value, level) accounts(code, value, amount, id) Task: Find amount from departments where a matching record exists in accounts with the same code. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18642
train
v2
Schema: schedules (alias: schd)(value, amount, level, status) products(type, value, level, date) Task: Find amount from schedules where a matching record exists in products with the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18643
train
v2
Schema: schedules (alias: schd)(id, value, name, status) staff(date, level, amount, id) Task: Retrieve name from schedules that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = schd.type );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18644
train
v1
Schema: projects (alias: prj)(date, status, salary, id) staff(type, amount, date, salary) Task: Find id from projects where id appears in staff entries with matching id. SQL:
SELECT id FROM projects AS prj WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = prj.id );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18645
train
v1
Schema: items (alias: lne)(type, code, amount, name) departments(name, amount, code, date) Task: Select code from items where status exists in departments for the same type. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = lne.type );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18646
train
v1
Schema: tasks (alias: tsk)(status, value, date, name) sales(amount, date, name, code) Task: Find code from tasks where id appears in sales entries with matching code. SQL:
SELECT code FROM tasks AS tsk WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18647
train
v1
Schema: regions (alias: rgn)(status, salary, id, date) tasks(date, code, amount, type) Task: Select code from regions where type exists in tasks for the same code. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18648
train
v1
Schema: employees (alias: emp)(value, date, name, status) customers(salary, name, type, code) Task: Select id from employees where id exists in customers for the same status. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18649
train
v1
Schema: requests (alias: ordr)(status, value, code, date) shipments(code, value, salary, date) Task: Find id from requests where type appears in shipments entries with matching status. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18650
train
v3
Schema: regions (alias: rgn)(level, salary, id, status) schedules(date, salary, status, name) Task: Find id from regions where amount exceeds the minimum salary from schedules for the same id. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18651
train
v3
Schema: employees (alias: emp)(date, value, amount, level) branches(id, status, value, name) Task: Find name from employees where value exceeds the count of amount from branches for the same type. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM branches AS brc WHERE brc.type = emp.type );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18652
train
v1
Schema: items (alias: lne)(type, value, id, name) sales(date, amount, status, code) Task: Find id from items where code appears in sales entries with matching type. SQL:
SELECT id FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18653
train
v2
Schema: projects (alias: prj)(status, id, value, code) orders(status, level, amount, id) Task: Find code from projects where a matching record exists in orders with the same code. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18654
train
v1
Schema: departments (alias: dept)(value, amount, code, status) employees(amount, id, date, level) Task: Find name from departments where status appears in employees entries with matching id. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18655
train
v1
Schema: transactions (alias: txn)(type, status, amount, id) categories(id, name, level, type) Task: Find amount from transactions where type appears in categories entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.code = txn.code );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18656
train
v1
Schema: projects (alias: prj)(level, salary, id, amount) shipments(salary, amount, name, value) Task: Select salary from projects where level exists in shipments for the same level. SQL:
SELECT salary FROM projects AS prj WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = prj.level );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18657
train
v3
Schema: staff (alias: empl)(amount, date, type, salary) branches(id, code, name, amount) Task: Find id from staff where salary exceeds the count of salary from branches for the same id. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.id = empl.id );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18658
train
v2
Schema: schedules (alias: schd)(id, amount, name, code) categories(amount, name, level, status) Task: Find value from schedules where a matching record exists in categories with the same id. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18659
train
v1
Schema: branches (alias: brc)(name, amount, value, code) tasks(name, id, code, status) Task: Find salary from branches where code appears in tasks entries with matching status. SQL:
SELECT salary FROM branches AS brc WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.status = brc.status );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18660
train
v3
Schema: items (alias: lne)(type, id, name, status) staff(salary, type, status, date) Task: Retrieve value from items with value above the MAX(amount) of staff rows sharing the same status. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.status = lne.status );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18661
train
v1
Schema: projects (alias: prj)(type, amount, date, level) orders(id, value, level, status) Task: Retrieve id from projects whose type is found in orders rows where code matches the outer record. SQL:
SELECT id FROM projects AS prj WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18662
train
v1
Schema: transactions (alias: txn)(code, level, type, value) accounts(salary, date, id, status) Task: Retrieve amount from transactions whose status is found in accounts rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18663
train
v1
Schema: departments (alias: dept)(type, status, salary, level) items(id, type, salary, name) Task: Find value from departments where id appears in items entries with matching type. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18664
train
v1
Schema: products (alias: prod)(value, date, type, status) accounts(value, level, status, id) Task: Select value from products where type exists in accounts for the same status. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18665
train
v1
Schema: items (alias: lne)(status, value, code, name) shipments(level, code, amount, status) Task: Select id from items where code exists in shipments for the same level. SQL:
SELECT id FROM items AS lne WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18666
train
v3
Schema: departments (alias: dept)(id, type, status, amount) transactions(name, code, type, level) Task: Retrieve value from departments with value above the MAX(amount) of transactions rows sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18667
train
v1
Schema: products (alias: prod)(level, amount, value, status) managers(status, code, date, value) Task: Find id from products where level appears in managers entries with matching code. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18668
train
v3
Schema: orders (alias: ord)(level, status, type, code) branches(status, date, name, amount) Task: Retrieve code from orders with salary above the SUM(salary) of branches rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.id = ord.id );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18669
train
v3
Schema: transactions (alias: txn)(value, salary, date, name) sales(status, date, id, name) Task: Retrieve value from transactions with salary above the SUM(salary) of sales rows sharing the same status. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18670
train
v2
Schema: schedules (alias: schd)(value, date, id, amount) projects(code, name, date, amount) Task: Retrieve value from schedules that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "value", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18671
train
v3
Schema: tasks (alias: tsk)(salary, id, code, name) items(name, value, id, salary) Task: Find name from tasks where value exceeds the minimum salary from items for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE value > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18672
train
v2
Schema: branches (alias: brc)(status, salary, id, level) regions(value, type, amount, code) Task: Retrieve code from branches that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = brc.level );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18673
train
v1
Schema: sales (alias: sale)(name, level, salary, type) customers(name, salary, id, code) Task: Select name from sales where type exists in customers for the same status. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18674
train
v1
Schema: accounts (alias: acct)(date, type, code, level) shipments(id, level, type, amount) Task: Find id from accounts where level appears in shipments entries with matching level. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18675
train
v3
Schema: sales (alias: sale)(level, id, name, status) projects(amount, level, salary, type) Task: Find name from sales where salary exceeds the maximum salary from projects for the same status. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18676
train
v2
Schema: transactions (alias: txn)(amount, level, id, value) invoices(name, type, date, code) Task: Retrieve salary from transactions that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18677
train
v1
Schema: staff (alias: empl)(id, value, type, level) orders(level, date, type, amount) Task: Select id from staff where level exists in orders for the same level. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18678
train
v2
Schema: sales (alias: sale)(date, level, amount, id) invoices(name, value, salary, date) Task: Find name from sales where a matching record exists in invoices with the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18679
train
v1
Schema: accounts (alias: acct)(type, date, id, value) staff(name, code, level, type) Task: Find name from accounts where id appears in staff entries with matching level. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18680
train
v2
Schema: requests (alias: ordr)(date, status, code, id) projects(id, status, amount, code) Task: Find id from requests where a matching record exists in projects with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18681
train
v3
Schema: categories (alias: catg)(status, id, value, type) customers(salary, value, code, date) Task: Retrieve value from categories with amount above the MAX(salary) of customers rows sharing the same code. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18682
train
v2
Schema: sales (alias: sale)(amount, date, name, level) staff(date, status, code, value) Task: Retrieve salary from sales that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18683
train
v2
Schema: accounts (alias: acct)(value, type, date, salary) requests(amount, name, salary, date) Task: Retrieve salary from accounts that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18684
train
v3
Schema: accounts (alias: acct)(type, value, salary, amount) items(level, id, type, salary) Task: Find amount from accounts where amount exceeds the average salary from items for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18685
train
v2
Schema: staff (alias: empl)(name, date, id, level) transactions(type, salary, date, code) Task: Retrieve code from staff that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = empl.id );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18686
train
v1
Schema: requests (alias: ordr)(id, amount, value, level) branches(name, salary, id, type) Task: Find amount from requests where id appears in branches entries with matching status. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18687
train
v2
Schema: products (alias: prod)(type, id, date, level) employees(type, salary, amount, value) Task: Find value from products where a matching record exists in employees with the same id. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18688
train
v1
Schema: staff (alias: empl)(level, status, code, amount) schedules(salary, code, type, status) Task: Find name from staff where level appears in schedules entries with matching id. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.id = empl.id );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18689
train
v3
Schema: schedules (alias: schd)(status, type, name, id) branches(id, amount, code, level) Task: Find name from schedules where salary exceeds the maximum amount from branches for the same id. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18690
train
v2
Schema: projects (alias: prj)(amount, status, salary, type) staff(level, date, type, id) Task: Retrieve id from projects that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = prj.type );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18691
train
v1
Schema: categories (alias: catg)(code, type, level, amount) sales(salary, value, code, id) Task: Find value from categories where level appears in sales entries with matching code. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = catg.code );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18692
train
v1
Schema: staff (alias: empl)(value, status, type, code) items(salary, amount, value, name) Task: Retrieve name from staff whose status is found in items rows where type matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = empl.type );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18693
train
v3
Schema: tasks (alias: tsk)(name, salary, status, amount) items(level, code, date, salary) Task: Retrieve code from tasks with salary above the COUNT(value) of items rows sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT COUNT(value) FROM items AS lne WHERE lne.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18694
train
v1
Schema: shipments (alias: shp)(code, name, level, status) tasks(code, type, date, status) Task: Find name from shipments where type appears in tasks entries with matching level. SQL:
SELECT name FROM shipments AS shp WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = shp.level );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18695
train
v1
Schema: schedules (alias: schd)(salary, code, level, id) items(amount, name, value, type) Task: Retrieve value from schedules whose status is found in items rows where status matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18696
train
v3
Schema: staff (alias: empl)(name, status, type, level) categories(date, type, amount, name) Task: Retrieve amount from staff with amount above the MAX(amount) of categories rows sharing the same type. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18697
train
v2
Schema: orders (alias: ord)(code, type, amount, value) projects(code, name, value, date) Task: Retrieve value from orders that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = ord.status );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "value", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18698
train
v2
Schema: staff (alias: empl)(amount, code, date, id) shipments(value, name, salary, code) Task: Retrieve value from staff that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18699
train