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
v3
Schema: customers (alias: cust)(id, amount, name, level) accounts(type, level, salary, name) Task: Retrieve code from customers with salary above the SUM(amount) of accounts rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04600
train
v2
Schema: projects (alias: prj)(date, type, amount, name) branches(code, status, level, name) Task: Find amount from projects where a matching record exists in branches with the same id. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = prj.id );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04601
train
v1
Schema: tasks (alias: tsk)(amount, name, status, salary) items(type, id, status, date) Task: Select code from tasks where code exists in items for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04602
train
v2
Schema: departments (alias: dept)(status, amount, type, date) transactions(id, value, date, salary) Task: Find id from departments where a matching record exists in transactions with the same level. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04603
train
v3
Schema: accounts (alias: acct)(level, date, code, value) projects(type, id, salary, level) Task: Find amount from accounts where value exceeds the average salary from projects for the same level. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.level = acct.level );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04604
train
v3
Schema: invoices (alias: inv)(level, code, name, salary) managers(name, type, level, status) Task: Retrieve name from invoices with value above the AVG(amount) of managers rows sharing the same type. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04605
train
v3
Schema: sales (alias: sale)(status, code, type, name) accounts(amount, name, date, code) Task: Retrieve name from sales with salary above the MIN(value) of accounts rows sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04606
train
v3
Schema: requests (alias: ordr)(name, amount, status, level) orders(status, id, code, date) Task: Find value from requests where salary exceeds the total value from orders for the same status. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT SUM(value) FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04607
train
v1
Schema: tasks (alias: tsk)(code, salary, status, level) departments(level, name, type, status) Task: Find value from tasks where status appears in departments entries with matching id. SQL:
SELECT value FROM tasks AS tsk WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04608
train
v1
Schema: tasks (alias: tsk)(name, level, salary, date) regions(status, id, salary, value) Task: Retrieve id from tasks whose id is found in regions rows where level matches the outer record. SQL:
SELECT id FROM tasks AS tsk WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04609
train
v2
Schema: departments (alias: dept)(type, code, status, date) orders(id, value, salary, level) Task: Find amount from departments where a matching record exists in orders with the same level. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04610
train
v3
Schema: transactions (alias: txn)(status, code, type, amount) staff(type, code, salary, level) Task: Retrieve amount from transactions with amount above the MIN(amount) of staff rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.code = txn.code );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04611
train
v3
Schema: items (alias: lne)(salary, date, amount, status) departments(status, type, id, code) Task: Retrieve name from items with salary above the COUNT(salary) of departments rows sharing the same level. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04612
train
v2
Schema: branches (alias: brc)(value, code, date, id) schedules(name, salary, status, amount) Task: Retrieve code from branches that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = brc.level );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04613
train
v1
Schema: sales (alias: sale)(status, id, value, salary) projects(code, type, status, salary) Task: Find name from sales where status appears in projects entries with matching status. SQL:
SELECT name FROM sales AS sale WHERE status IN ( SELECT status 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": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04614
train
v3
Schema: accounts (alias: acct)(id, type, value, level) managers(amount, date, code, type) Task: Retrieve id from accounts with amount above the MIN(value) of managers rows sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04615
train
v1
Schema: items (alias: lne)(id, code, name, value) customers(amount, level, name, id) Task: Select id from items where id exists in customers for the same type. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04616
train
v2
Schema: accounts (alias: acct)(value, name, amount, status) departments(type, salary, level, date) Task: Retrieve amount from accounts that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = acct.type );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04617
train
v2
Schema: staff (alias: empl)(name, type, level, status) shipments(amount, level, value, status) Task: Retrieve name from staff that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT name 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": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04618
train
v2
Schema: items (alias: lne)(level, name, value, code) shipments(amount, level, type, status) Task: Find code from items where a matching record exists in shipments with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04619
train
v3
Schema: items (alias: lne)(id, amount, level, value) managers(level, type, name, salary) Task: Find name from items where value exceeds the total amount from managers for the same type. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04620
train
v1
Schema: accounts (alias: acct)(status, date, code, amount) branches(code, status, id, type) Task: Find value from accounts where code appears in branches entries with matching type. SQL:
SELECT value FROM accounts AS acct WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04621
train
v3
Schema: managers (alias: mgr)(name, amount, id, status) tasks(status, date, name, amount) Task: Find code from managers where amount exceeds the count of salary from tasks for the same status. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT COUNT(salary) FROM tasks AS tsk WHERE tsk.status = mgr.status );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04622
train
v3
Schema: sales (alias: sale)(amount, salary, code, id) orders(name, salary, date, code) Task: Find value from sales where amount exceeds the total value from orders for the same id. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.id = sale.id );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04623
train
v3
Schema: shipments (alias: shp)(level, name, status, date) categories(salary, name, type, status) Task: Find name from shipments where salary exceeds the maximum value from categories for the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT MAX(value) FROM categories AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04624
train
v3
Schema: accounts (alias: acct)(id, level, name, code) sales(id, name, type, code) Task: Find salary from accounts where value exceeds the maximum amount from sales for the same code. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04625
train
v3
Schema: staff (alias: empl)(value, date, code, type) items(name, id, code, salary) Task: Retrieve code from staff with amount above the SUM(value) of items rows sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT SUM(value) FROM items AS lne WHERE lne.id = empl.id );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04626
train
v1
Schema: categories (alias: catg)(salary, status, amount, name) customers(code, type, status, salary) Task: Retrieve code from categories whose level is found in customers rows where code matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04627
train
v2
Schema: products (alias: prod)(status, amount, name, id) invoices(type, id, level, code) Task: Find name from products where a matching record exists in invoices with the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04628
train
v1
Schema: regions (alias: rgn)(level, type, salary, value) sales(status, name, amount, type) Task: Retrieve amount from regions whose level is found in sales rows where level matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04629
train
v3
Schema: tasks (alias: tsk)(amount, code, name, level) employees(name, date, code, value) Task: Retrieve amount from tasks with amount above the MAX(amount) of employees rows sharing the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04630
train
v2
Schema: projects (alias: prj)(date, type, name, salary) staff(id, code, level, value) Task: Find name from projects where a matching record exists in staff with the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = prj.id );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04631
train
v3
Schema: tasks (alias: tsk)(salary, type, level, status) customers(status, type, id, name) Task: Retrieve code from tasks with salary above the MIN(amount) of customers rows sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04632
train
v3
Schema: schedules (alias: schd)(name, code, value, date) sales(code, amount, type, level) Task: Retrieve value from schedules with amount above the SUM(value) of sales rows sharing the same type. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04633
train
v1
Schema: orders (alias: ord)(date, status, level, code) departments(type, salary, status, id) Task: Retrieve name from orders whose level is found in departments rows where type matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE level IN ( SELECT level 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": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04634
train
v2
Schema: staff (alias: empl)(date, amount, code, value) items(id, salary, amount, type) Task: Find name from staff where a matching record exists in items with the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = empl.type );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04635
train
v2
Schema: customers (alias: cust)(code, amount, name, date) transactions(value, id, level, status) Task: Find salary from customers where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = cust.type );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04636
train
v2
Schema: tasks (alias: tsk)(salary, type, date, id) projects(amount, id, name, code) Task: Find salary from tasks where a matching record exists in projects with the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "salary", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04637
train
v2
Schema: staff (alias: empl)(code, name, type, id) employees(level, value, name, id) Task: Retrieve salary from staff that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04638
train
v3
Schema: employees (alias: emp)(type, salary, code, id) branches(salary, code, name, status) Task: Retrieve salary from employees with amount above the MAX(amount) of branches rows sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04639
train
v2
Schema: managers (alias: mgr)(code, salary, value, level) transactions(salary, date, name, level) Task: Find code from managers where a matching record exists in transactions with the same id. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04640
train
v3
Schema: sales (alias: sale)(status, value, amount, date) categories(value, salary, date, level) Task: Retrieve name from sales with value above the AVG(value) of categories rows sharing the same level. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04641
train
v1
Schema: staff (alias: empl)(name, salary, type, status) sales(code, date, value, level) Task: Select amount from staff where id exists in sales for the same code. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04642
train
v1
Schema: orders (alias: ord)(salary, status, type, amount) managers(name, salary, value, type) Task: Retrieve code from orders whose status is found in managers rows where id matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04643
train
v1
Schema: transactions (alias: txn)(salary, value, name, amount) items(id, code, status, level) Task: Select code from transactions where code exists in items for the same code. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04644
train
v3
Schema: customers (alias: cust)(id, amount, code, status) categories(amount, id, value, level) Task: Retrieve value from customers with salary above the MAX(salary) of categories rows sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04645
train
v3
Schema: invoices (alias: inv)(status, id, level, amount) items(id, value, status, type) Task: Retrieve id from invoices with amount above the COUNT(amount) of items rows sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04646
train
v2
Schema: projects (alias: prj)(amount, code, salary, level) requests(name, id, salary, date) Task: Find salary from projects where a matching record exists in requests with the same status. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = prj.status );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "salary", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04647
train
v2
Schema: branches (alias: brc)(level, type, salary, value) departments(code, id, status, type) Task: Find code from branches where a matching record exists in departments with the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = brc.code );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04648
train
v2
Schema: transactions (alias: txn)(level, name, value, salary) items(date, type, value, salary) Task: Find code from transactions where a matching record exists in items with the same code. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04649
train
v1
Schema: employees (alias: emp)(code, id, name, status) categories(status, code, date, id) Task: Find code from employees where id appears in categories entries with matching status. SQL:
SELECT code FROM employees AS emp WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = emp.status );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04650
train
v2
Schema: orders (alias: ord)(salary, id, name, value) transactions(level, amount, value, id) Task: Find value from orders where a matching record exists in transactions with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04651
train
v3
Schema: accounts (alias: acct)(salary, level, date, status) products(date, level, code, salary) Task: Find code from accounts where value exceeds the minimum amount from products for the same level. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.level = acct.level );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04652
train
v3
Schema: products (alias: prod)(amount, code, level, type) employees(code, amount, salary, value) Task: Retrieve code from products with value above the AVG(value) of employees rows sharing the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT AVG(value) FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04653
train
v3
Schema: sales (alias: sale)(date, code, salary, level) employees(level, salary, type, code) Task: Find id from sales where salary exceeds the total salary from employees for the same level. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.level = sale.level );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04654
train
v2
Schema: items (alias: lne)(status, id, value, date) schedules(id, type, date, name) Task: Find name from items where a matching record exists in schedules with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04655
train
v1
Schema: shipments (alias: shp)(date, value, salary, code) items(id, salary, status, value) Task: Find amount from shipments where level appears in items entries with matching code. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04656
train
v1
Schema: regions (alias: rgn)(level, name, salary, value) shipments(code, value, date, salary) Task: Select amount from regions where type exists in shipments for the same code. SQL:
SELECT amount FROM regions AS rgn WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04657
train
v3
Schema: tasks (alias: tsk)(date, level, code, amount) customers(type, status, level, value) Task: Find amount from tasks where salary exceeds the average value from customers for the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE salary > ( SELECT AVG(value) FROM customers AS cust WHERE cust.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04658
train
v3
Schema: categories (alias: catg)(date, type, code, level) accounts(name, value, type, level) Task: Find name from categories where salary exceeds the count of value from accounts for the same code. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04659
train
v3
Schema: projects (alias: prj)(value, type, level, code) schedules(amount, code, value, status) Task: Find name from projects where salary exceeds the minimum amount from schedules for the same level. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.level = prj.level );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04660
train
v1
Schema: employees (alias: emp)(value, code, name, level) regions(name, code, value, amount) Task: Retrieve code from employees whose status is found in regions rows where code matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04661
train
v3
Schema: items (alias: lne)(id, code, name, status) categories(value, amount, date, status) Task: Retrieve amount from items with salary above the MAX(amount) of categories rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04662
train
v3
Schema: customers (alias: cust)(type, status, salary, date) regions(status, name, date, level) Task: Find name from customers where salary exceeds the count of salary from regions for the same type. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04663
train
v1
Schema: tasks (alias: tsk)(salary, amount, status, code) orders(name, salary, type, date) Task: Find amount from tasks where level appears in orders entries with matching status. SQL:
SELECT amount FROM tasks AS tsk WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04664
train
v3
Schema: regions (alias: rgn)(name, code, salary, value) items(code, level, type, name) Task: Find name from regions where salary exceeds the maximum value from items for the same code. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MAX(value) FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04665
train
v3
Schema: employees (alias: emp)(amount, date, id, salary) customers(code, value, status, date) Task: Find name from employees where value exceeds the count of salary from customers for the same id. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04666
train
v1
Schema: sales (alias: sale)(status, amount, date, value) transactions(amount, code, status, level) Task: Select id from sales where type exists in transactions for the same status. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04667
train
v1
Schema: categories (alias: catg)(amount, code, name, type) sales(amount, code, value, name) Task: Select value from categories where type exists in sales for the same type. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = catg.type );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04668
train
v3
Schema: categories (alias: catg)(type, level, amount, salary) transactions(name, level, amount, date) Task: Find value from categories where salary exceeds the average salary from transactions for the same status. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04669
train
v3
Schema: departments (alias: dept)(value, date, level, type) employees(type, status, amount, value) Task: Find name from departments where amount exceeds the average salary from employees for the same id. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT AVG(salary) 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": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04670
train
v1
Schema: invoices (alias: inv)(value, status, salary, code) customers(value, name, type, salary) Task: Select code from invoices where id exists in customers for the same code. SQL:
SELECT code FROM invoices AS inv WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04671
train
v1
Schema: transactions (alias: txn)(name, salary, id, value) employees(type, salary, level, name) Task: Find amount from transactions where type appears in employees entries with matching status. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04672
train
v2
Schema: products (alias: prod)(value, id, name, level) employees(amount, code, id, status) Task: Find code from products where a matching record exists in employees with the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04673
train
v2
Schema: staff (alias: empl)(level, value, date, name) customers(status, type, code, salary) Task: Find value from staff where a matching record exists in customers with the same id. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = empl.id );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04674
train
v3
Schema: invoices (alias: inv)(salary, value, code, type) accounts(amount, value, code, salary) Task: Find value from invoices where value exceeds the maximum amount from accounts for the same type. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = inv.type );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04675
train
v2
Schema: products (alias: prod)(name, type, status, level) managers(type, date, level, salary) Task: Retrieve code from products that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04676
train
v3
Schema: regions (alias: rgn)(name, status, id, type) customers(status, code, value, id) Task: Retrieve name from regions with value above the MAX(amount) of customers rows sharing the same status. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04677
train
v1
Schema: categories (alias: catg)(amount, id, name, level) departments(value, status, id, salary) Task: Select name from categories where level exists in departments for the same level. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04678
train
v2
Schema: staff (alias: empl)(value, amount, level, status) requests(code, salary, id, type) Task: Find amount from staff where a matching record exists in requests with the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04679
train
v1
Schema: accounts (alias: acct)(level, id, status, date) employees(type, status, id, level) Task: Retrieve amount from accounts whose id is found in employees rows where type matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04680
train
v1
Schema: customers (alias: cust)(name, type, id, date) invoices(amount, name, code, id) Task: Select name from customers where level exists in invoices for the same code. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04681
train
v2
Schema: requests (alias: ordr)(name, type, level, id) shipments(amount, salary, name, value) Task: Find code from requests where a matching record exists in shipments with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04682
train
v1
Schema: orders (alias: ord)(type, value, date, salary) staff(date, code, status, id) Task: Select salary from orders where code exists in staff for the same type. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04683
train
v3
Schema: employees (alias: emp)(value, salary, code, date) staff(code, id, type, salary) Task: Retrieve id from employees with amount above the MAX(amount) of staff rows sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04684
train
v3
Schema: products (alias: prod)(salary, type, status, date) employees(id, level, code, status) Task: Find salary from products where amount exceeds the average value from employees for the same code. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.code = prod.code );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04685
train
v1
Schema: employees (alias: emp)(level, code, date, salary) customers(code, value, name, id) Task: Find code from employees where code appears in customers entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04686
train
v1
Schema: projects (alias: prj)(value, level, id, date) sales(id, date, status, name) Task: Select code from projects where code exists in sales for the same level. SQL:
SELECT code FROM projects AS prj WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = prj.level );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04687
train
v1
Schema: customers (alias: cust)(type, name, status, level) employees(salary, code, date, amount) Task: Retrieve name from customers whose type is found in employees rows where id matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04688
train
v3
Schema: products (alias: prod)(name, type, id, value) shipments(level, code, type, value) Task: Retrieve name from products with value above the MIN(value) of shipments rows sharing the same level. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.level = prod.level );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04689
train
v3
Schema: tasks (alias: tsk)(amount, type, id, level) customers(value, status, date, type) Task: Find code from tasks where amount exceeds the total value from customers for the same status. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT SUM(value) FROM customers AS cust WHERE cust.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04690
train
v3
Schema: requests (alias: ordr)(date, value, name, code) departments(level, code, type, value) Task: Find code from requests where salary exceeds the total salary from departments for the same level. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.level = ordr.level );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04691
train
v2
Schema: managers (alias: mgr)(date, name, level, amount) invoices(status, name, type, salary) Task: Find name from managers where a matching record exists in invoices with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = mgr.code );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04692
train
v3
Schema: transactions (alias: txn)(id, amount, value, salary) products(status, amount, name, date) Task: Find salary from transactions where value exceeds the maximum salary from products for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04693
train
v1
Schema: shipments (alias: shp)(status, code, name, type) categories(salary, type, amount, status) Task: Retrieve name from shipments whose level is found in categories rows where type matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04694
train
v1
Schema: projects (alias: prj)(date, level, amount, status) tasks(status, level, date, id) Task: Select id from projects where type exists in tasks for the same id. SQL:
SELECT id FROM projects AS prj WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = prj.id );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04695
train
v3
Schema: shipments (alias: shp)(date, level, value, id) orders(salary, amount, code, level) Task: Find value from shipments where salary exceeds the minimum salary from orders for the same id. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04696
train
v3
Schema: items (alias: lne)(value, code, level, name) staff(level, value, code, salary) Task: Find amount from items where amount exceeds the maximum value from staff for the same level. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM staff AS empl WHERE empl.level = lne.level );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04697
train
v2
Schema: managers (alias: mgr)(id, type, status, value) departments(date, name, amount, value) Task: Find name from managers where a matching record exists in departments with the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04698
train
v2
Schema: requests (alias: ordr)(level, id, status, code) shipments(date, status, code, name) Task: Find id from requests where a matching record exists in shipments with the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04699
train